@purchasely/react-native-purchasely-huawei 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Purchasely SAS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,12 @@
1
+ # react-native-purchasely-huawei
2
+
3
+ Purchasely Huawei Mobile Services dependencies
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install react-native-purchasely-huawei
9
+ ```
10
+ ## License
11
+
12
+ Copyright (c) 2022 Purchasely SAS
@@ -0,0 +1,137 @@
1
+ buildscript {
2
+ // Buildscript is evaluated before everything else so we can't use getExtOrDefault
3
+ def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['PurchaselyHuawei_kotlinVersion']
4
+
5
+ repositories {
6
+ google()
7
+ mavenCentral()
8
+ jcenter()
9
+ maven { url 'https://developer.huawei.com/repo/' }
10
+ }
11
+
12
+ dependencies {
13
+ classpath 'com.android.tools.build:gradle:7.0.4'
14
+ // noinspection DifferentKotlinGradleVersion
15
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16
+ classpath 'com.huawei.agconnect:agcp:1.6.0.300'
17
+ }
18
+ }
19
+
20
+ apply plugin: 'com.android.library'
21
+ apply plugin: 'kotlin-android'
22
+ apply plugin: 'com.huawei.agconnect'
23
+
24
+ def getExtOrDefault(name) {
25
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['PurchaselyHuawei_' + name]
26
+ }
27
+
28
+ def getExtOrIntegerDefault(name) {
29
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['PurchaselyHuawei_' + name]).toInteger()
30
+ }
31
+
32
+ android {
33
+ compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
34
+ buildToolsVersion getExtOrDefault('buildToolsVersion')
35
+ defaultConfig {
36
+ minSdkVersion 21
37
+ targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
38
+ versionCode 1
39
+ versionName "1.0"
40
+
41
+ }
42
+
43
+ buildTypes {
44
+ release {
45
+ minifyEnabled false
46
+ }
47
+ }
48
+ lintOptions {
49
+ disable 'GradleCompatible'
50
+ }
51
+ compileOptions {
52
+ sourceCompatibility JavaVersion.VERSION_1_8
53
+ targetCompatibility JavaVersion.VERSION_1_8
54
+ }
55
+ }
56
+
57
+ repositories {
58
+ mavenCentral()
59
+ jcenter()
60
+ google()
61
+ maven { url 'https://developer.huawei.com/repo/' }
62
+
63
+ def found = false
64
+ def defaultDir = null
65
+ def androidSourcesName = 'React Native sources'
66
+
67
+ if (rootProject.ext.has('reactNativeAndroidRoot')) {
68
+ defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
69
+ } else {
70
+ defaultDir = new File(
71
+ projectDir,
72
+ '/../../../node_modules/react-native/android'
73
+ )
74
+ }
75
+
76
+ if (defaultDir.exists()) {
77
+ maven {
78
+ url defaultDir.toString()
79
+ name androidSourcesName
80
+ }
81
+
82
+ logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
83
+ found = true
84
+ } else {
85
+ def parentDir = rootProject.projectDir
86
+
87
+ 1.upto(5, {
88
+ if (found) return true
89
+ parentDir = parentDir.parentFile
90
+
91
+ def androidSourcesDir = new File(
92
+ parentDir,
93
+ 'node_modules/react-native'
94
+ )
95
+
96
+ def androidPrebuiltBinaryDir = new File(
97
+ parentDir,
98
+ 'node_modules/react-native/android'
99
+ )
100
+
101
+ if (androidPrebuiltBinaryDir.exists()) {
102
+ maven {
103
+ url androidPrebuiltBinaryDir.toString()
104
+ name androidSourcesName
105
+ }
106
+
107
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
108
+ found = true
109
+ } else if (androidSourcesDir.exists()) {
110
+ maven {
111
+ url androidSourcesDir.toString()
112
+ name androidSourcesName
113
+ }
114
+
115
+ logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
116
+ found = true
117
+ }
118
+ })
119
+ }
120
+
121
+ if (!found) {
122
+ throw new GradleException(
123
+ "${project.name}: unable to locate React Native android sources. " +
124
+ "Ensure you have you installed React Native as a dependency in your project and try again."
125
+ )
126
+ }
127
+ }
128
+
129
+ def kotlin_version = getExtOrDefault('kotlinVersion')
130
+
131
+ dependencies {
132
+ // noinspection GradleDynamicVersion
133
+ api 'com.facebook.react:react-native:+'
134
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
135
+
136
+ implementation 'io.purchasely:huawei-services:3.2.2'
137
+ }
@@ -0,0 +1,10 @@
1
+ PurchaselyHuawei_kotlinVersion=1.6.10
2
+ PurchaselyHuawei_compileSdkVersion=29
3
+ PurchaselyHuawei_targetSdkVersion=29
4
+ PurchaselyHuawei_buildToolsVersion=30.0.2
5
+
6
+ android.useAndroidX=true
7
+ # Automatically convert third-party libraries to use AndroidX
8
+ android.enableJetifier=true
9
+
10
+ org.gradle.jvmargs=-Xmx4g
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.reactnativepurchaselyhuawei">
3
+
4
+ </manifest>
@@ -0,0 +1,24 @@
1
+ package com.reactnativepurchaselyhuawei
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
5
+ import com.facebook.react.bridge.ReactMethod
6
+ import com.facebook.react.bridge.Promise
7
+
8
+ class PurchaselyHuaweiModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
9
+
10
+ override fun getName(): String {
11
+ return "PurchaselyHuawei"
12
+ }
13
+
14
+ // Example method
15
+ // See https://reactnative.dev/docs/native-modules-android
16
+ @ReactMethod
17
+ fun multiply(a: Int, b: Int, promise: Promise) {
18
+
19
+ promise.resolve(a * b)
20
+
21
+ }
22
+
23
+
24
+ }
@@ -0,0 +1,17 @@
1
+ package com.reactnativepurchaselyhuawei
2
+
3
+ import com.facebook.react.ReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.uimanager.ViewManager
7
+
8
+
9
+ class PurchaselyHuaweiPackage : ReactPackage {
10
+ override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
11
+ return listOf(PurchaselyHuaweiModule(reactContext))
12
+ }
13
+
14
+ override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
15
+ return emptyList()
16
+ }
17
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,9 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(PurchaselyHuawei, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
6
+ withResolver:(RCTPromiseResolveBlock)resolve
7
+ withRejecter:(RCTPromiseRejectBlock)reject)
8
+
9
+ @end
@@ -0,0 +1,8 @@
1
+ @objc(PurchaselyHuawei)
2
+ class PurchaselyHuawei: NSObject {
3
+
4
+ @objc(multiply:withB:withResolver:withRejecter:)
5
+ func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
6
+ resolve(a*b)
7
+ }
8
+ }
@@ -0,0 +1,293 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 46;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+
11
+ 5E555C0D2413F4C50049A1A2 /* PurchaselyHuawei.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* PurchaselyHuawei.m */; };
12
+ F4FF95D7245B92E800C19C63 /* PurchaselyHuawei.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4FF95D6245B92E800C19C63 /* PurchaselyHuawei.swift */; };
13
+
14
+ /* End PBXBuildFile section */
15
+
16
+ /* Begin PBXCopyFilesBuildPhase section */
17
+ 58B511D91A9E6C8500147676 /* CopyFiles */ = {
18
+ isa = PBXCopyFilesBuildPhase;
19
+ buildActionMask = 2147483647;
20
+ dstPath = "include/$(PRODUCT_NAME)";
21
+ dstSubfolderSpec = 16;
22
+ files = (
23
+ );
24
+ runOnlyForDeploymentPostprocessing = 0;
25
+ };
26
+ /* End PBXCopyFilesBuildPhase section */
27
+
28
+ /* Begin PBXFileReference section */
29
+ 134814201AA4EA6300B7C361 /* libPurchaselyHuawei.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPurchaselyHuawei.a; sourceTree = BUILT_PRODUCTS_DIR; };
30
+
31
+ B3E7B5891CC2AC0600A0062D /* PurchaselyHuawei.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PurchaselyHuawei.m; sourceTree = "<group>"; };
32
+ F4FF95D5245B92E700C19C63 /* PurchaselyHuawei-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PurchaselyHuawei-Bridging-Header.h"; sourceTree = "<group>"; };
33
+ F4FF95D6245B92E800C19C63 /* PurchaselyHuawei.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaselyHuawei.swift; sourceTree = "<group>"; };
34
+
35
+ /* End PBXFileReference section */
36
+
37
+ /* Begin PBXFrameworksBuildPhase section */
38
+ 58B511D81A9E6C8500147676 /* Frameworks */ = {
39
+ isa = PBXFrameworksBuildPhase;
40
+ buildActionMask = 2147483647;
41
+ files = (
42
+ );
43
+ runOnlyForDeploymentPostprocessing = 0;
44
+ };
45
+ /* End PBXFrameworksBuildPhase section */
46
+
47
+ /* Begin PBXGroup section */
48
+ 134814211AA4EA7D00B7C361 /* Products */ = {
49
+ isa = PBXGroup;
50
+ children = (
51
+ 134814201AA4EA6300B7C361 /* libPurchaselyHuawei.a */,
52
+ );
53
+ name = Products;
54
+ sourceTree = "<group>";
55
+ };
56
+ 58B511D21A9E6C8500147676 = {
57
+ isa = PBXGroup;
58
+ children = (
59
+
60
+ F4FF95D6245B92E800C19C63 /* PurchaselyHuawei.swift */,
61
+ B3E7B5891CC2AC0600A0062D /* PurchaselyHuawei.m */,
62
+ F4FF95D5245B92E700C19C63 /* PurchaselyHuawei-Bridging-Header.h */,
63
+
64
+ 134814211AA4EA7D00B7C361 /* Products */,
65
+ );
66
+ sourceTree = "<group>";
67
+ };
68
+ /* End PBXGroup section */
69
+
70
+ /* Begin PBXNativeTarget section */
71
+ 58B511DA1A9E6C8500147676 /* PurchaselyHuawei */ = {
72
+ isa = PBXNativeTarget;
73
+ buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PurchaselyHuawei" */;
74
+ buildPhases = (
75
+ 58B511D71A9E6C8500147676 /* Sources */,
76
+ 58B511D81A9E6C8500147676 /* Frameworks */,
77
+ 58B511D91A9E6C8500147676 /* CopyFiles */,
78
+ );
79
+ buildRules = (
80
+ );
81
+ dependencies = (
82
+ );
83
+ name = PurchaselyHuawei;
84
+ productName = RCTDataManager;
85
+ productReference = 134814201AA4EA6300B7C361 /* libPurchaselyHuawei.a */;
86
+ productType = "com.apple.product-type.library.static";
87
+ };
88
+ /* End PBXNativeTarget section */
89
+
90
+ /* Begin PBXProject section */
91
+ 58B511D31A9E6C8500147676 /* Project object */ = {
92
+ isa = PBXProject;
93
+ attributes = {
94
+ LastUpgradeCheck = 0920;
95
+ ORGANIZATIONNAME = Facebook;
96
+ TargetAttributes = {
97
+ 58B511DA1A9E6C8500147676 = {
98
+ CreatedOnToolsVersion = 6.1.1;
99
+ };
100
+ };
101
+ };
102
+ buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PurchaselyHuawei" */;
103
+ compatibilityVersion = "Xcode 3.2";
104
+ developmentRegion = English;
105
+ hasScannedForEncodings = 0;
106
+ knownRegions = (
107
+ English,
108
+ en,
109
+ );
110
+ mainGroup = 58B511D21A9E6C8500147676;
111
+ productRefGroup = 58B511D21A9E6C8500147676;
112
+ projectDirPath = "";
113
+ projectRoot = "";
114
+ targets = (
115
+ 58B511DA1A9E6C8500147676 /* PurchaselyHuawei */,
116
+ );
117
+ };
118
+ /* End PBXProject section */
119
+
120
+ /* Begin PBXSourcesBuildPhase section */
121
+ 58B511D71A9E6C8500147676 /* Sources */ = {
122
+ isa = PBXSourcesBuildPhase;
123
+ buildActionMask = 2147483647;
124
+ files = (
125
+
126
+ F4FF95D7245B92E800C19C63 /* PurchaselyHuawei.swift in Sources */,
127
+ B3E7B58A1CC2AC0600A0062D /* PurchaselyHuawei.m in Sources */,
128
+
129
+ );
130
+ runOnlyForDeploymentPostprocessing = 0;
131
+ };
132
+ /* End PBXSourcesBuildPhase section */
133
+
134
+ /* Begin XCBuildConfiguration section */
135
+ 58B511ED1A9E6C8500147676 /* Debug */ = {
136
+ isa = XCBuildConfiguration;
137
+ buildSettings = {
138
+ ALWAYS_SEARCH_USER_PATHS = NO;
139
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
140
+ CLANG_CXX_LIBRARY = "libc++";
141
+ CLANG_ENABLE_MODULES = YES;
142
+ CLANG_ENABLE_OBJC_ARC = YES;
143
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
144
+ CLANG_WARN_BOOL_CONVERSION = YES;
145
+ CLANG_WARN_COMMA = YES;
146
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
147
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
148
+ CLANG_WARN_EMPTY_BODY = YES;
149
+ CLANG_WARN_ENUM_CONVERSION = YES;
150
+ CLANG_WARN_INFINITE_RECURSION = YES;
151
+ CLANG_WARN_INT_CONVERSION = YES;
152
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
153
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
154
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
155
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
156
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
157
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
158
+ CLANG_WARN_UNREACHABLE_CODE = YES;
159
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
160
+ COPY_PHASE_STRIP = NO;
161
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
162
+ ENABLE_TESTABILITY = YES;
163
+ GCC_C_LANGUAGE_STANDARD = gnu99;
164
+ GCC_DYNAMIC_NO_PIC = NO;
165
+ GCC_NO_COMMON_BLOCKS = YES;
166
+ GCC_OPTIMIZATION_LEVEL = 0;
167
+ GCC_PREPROCESSOR_DEFINITIONS = (
168
+ "DEBUG=1",
169
+ "$(inherited)",
170
+ );
171
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
172
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
173
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
174
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
175
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
176
+ GCC_WARN_UNUSED_FUNCTION = YES;
177
+ GCC_WARN_UNUSED_VARIABLE = YES;
178
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
179
+ MTL_ENABLE_DEBUG_INFO = YES;
180
+ ONLY_ACTIVE_ARCH = YES;
181
+ SDKROOT = iphoneos;
182
+ };
183
+ name = Debug;
184
+ };
185
+ 58B511EE1A9E6C8500147676 /* Release */ = {
186
+ isa = XCBuildConfiguration;
187
+ buildSettings = {
188
+ ALWAYS_SEARCH_USER_PATHS = NO;
189
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
190
+ CLANG_CXX_LIBRARY = "libc++";
191
+ CLANG_ENABLE_MODULES = YES;
192
+ CLANG_ENABLE_OBJC_ARC = YES;
193
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
194
+ CLANG_WARN_BOOL_CONVERSION = YES;
195
+ CLANG_WARN_COMMA = YES;
196
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
197
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
198
+ CLANG_WARN_EMPTY_BODY = YES;
199
+ CLANG_WARN_ENUM_CONVERSION = YES;
200
+ CLANG_WARN_INFINITE_RECURSION = YES;
201
+ CLANG_WARN_INT_CONVERSION = YES;
202
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
203
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
204
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
205
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
206
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
207
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
208
+ CLANG_WARN_UNREACHABLE_CODE = YES;
209
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
210
+ COPY_PHASE_STRIP = YES;
211
+ ENABLE_NS_ASSERTIONS = NO;
212
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
213
+ GCC_C_LANGUAGE_STANDARD = gnu99;
214
+ GCC_NO_COMMON_BLOCKS = YES;
215
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
216
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
217
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
218
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
219
+ GCC_WARN_UNUSED_FUNCTION = YES;
220
+ GCC_WARN_UNUSED_VARIABLE = YES;
221
+ IPHONEOS_DEPLOYMENT_TARGET = 8.0;
222
+ MTL_ENABLE_DEBUG_INFO = NO;
223
+ SDKROOT = iphoneos;
224
+ VALIDATE_PRODUCT = YES;
225
+ };
226
+ name = Release;
227
+ };
228
+ 58B511F01A9E6C8500147676 /* Debug */ = {
229
+ isa = XCBuildConfiguration;
230
+ buildSettings = {
231
+ HEADER_SEARCH_PATHS = (
232
+ "$(inherited)",
233
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
234
+ "$(SRCROOT)/../../../React/**",
235
+ "$(SRCROOT)/../../react-native/React/**",
236
+ );
237
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
238
+ OTHER_LDFLAGS = "-ObjC";
239
+ PRODUCT_NAME = PurchaselyHuawei;
240
+ SKIP_INSTALL = YES;
241
+
242
+ SWIFT_OBJC_BRIDGING_HEADER = "PurchaselyHuawei-Bridging-Header.h";
243
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
244
+ SWIFT_VERSION = 5.0;
245
+
246
+ };
247
+ name = Debug;
248
+ };
249
+ 58B511F11A9E6C8500147676 /* Release */ = {
250
+ isa = XCBuildConfiguration;
251
+ buildSettings = {
252
+ HEADER_SEARCH_PATHS = (
253
+ "$(inherited)",
254
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
255
+ "$(SRCROOT)/../../../React/**",
256
+ "$(SRCROOT)/../../react-native/React/**",
257
+ );
258
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
259
+ OTHER_LDFLAGS = "-ObjC";
260
+ PRODUCT_NAME = PurchaselyHuawei;
261
+ SKIP_INSTALL = YES;
262
+
263
+ SWIFT_OBJC_BRIDGING_HEADER = "PurchaselyHuawei-Bridging-Header.h";
264
+ SWIFT_VERSION = 5.0;
265
+
266
+ };
267
+ name = Release;
268
+ };
269
+ /* End XCBuildConfiguration section */
270
+
271
+ /* Begin XCConfigurationList section */
272
+ 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "PurchaselyHuawei" */ = {
273
+ isa = XCConfigurationList;
274
+ buildConfigurations = (
275
+ 58B511ED1A9E6C8500147676 /* Debug */,
276
+ 58B511EE1A9E6C8500147676 /* Release */,
277
+ );
278
+ defaultConfigurationIsVisible = 0;
279
+ defaultConfigurationName = Release;
280
+ };
281
+ 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "PurchaselyHuawei" */ = {
282
+ isa = XCConfigurationList;
283
+ buildConfigurations = (
284
+ 58B511F01A9E6C8500147676 /* Debug */,
285
+ 58B511F11A9E6C8500147676 /* Release */,
286
+ );
287
+ defaultConfigurationIsVisible = 0;
288
+ defaultConfigurationName = Release;
289
+ };
290
+ /* End XCConfigurationList section */
291
+ };
292
+ rootObject = 58B511D31A9E6C8500147676 /* Project object */;
293
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.multiply = multiply;
7
+
8
+ var _reactNative = require("react-native");
9
+
10
+ const LINKING_ERROR = `The package 'react-native-purchasely-huawei' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
11
+ ios: "- You have run 'pod install'\n",
12
+ default: ''
13
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
14
+ const PurchaselyHuawei = _reactNative.NativeModules.PurchaselyHuawei ? _reactNative.NativeModules.PurchaselyHuawei : new Proxy({}, {
15
+ get() {
16
+ throw new Error(LINKING_ERROR);
17
+ }
18
+
19
+ });
20
+
21
+ function multiply(a, b) {
22
+ return PurchaselyHuawei.multiply(a, b);
23
+ }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","PurchaselyHuawei","NativeModules","Proxy","get","Error","multiply","a","b"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-purchasely-huawei' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PurchaselyHuawei = NativeModules.PurchaselyHuawei\n ? NativeModules.PurchaselyHuawei\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function multiply(a: number, b: number): Promise<number> {\n return PurchaselyHuawei.multiply(a, b);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,aAAa,GAChB,yFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,gBAAgB,GAAGC,0BAAA,CAAcD,gBAAd,GACrBC,0BAAA,CAAcD,gBADO,GAErB,IAAIE,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUT,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;;AAWO,SAASU,QAAT,CAAkBC,CAAlB,EAA6BC,CAA7B,EAAyD;EAC9D,OAAOP,gBAAgB,CAACK,QAAjB,CAA0BC,CAA1B,EAA6BC,CAA7B,CAAP;AACD"}
@@ -0,0 +1,15 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ const LINKING_ERROR = `The package 'react-native-purchasely-huawei' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
3
+ ios: "- You have run 'pod install'\n",
4
+ default: ''
5
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
6
+ const PurchaselyHuawei = NativeModules.PurchaselyHuawei ? NativeModules.PurchaselyHuawei : new Proxy({}, {
7
+ get() {
8
+ throw new Error(LINKING_ERROR);
9
+ }
10
+
11
+ });
12
+ export function multiply(a, b) {
13
+ return PurchaselyHuawei.multiply(a, b);
14
+ }
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","PurchaselyHuawei","Proxy","get","Error","multiply","a","b"],"sources":["index.tsx"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\n\nconst LINKING_ERROR =\n `The package 'react-native-purchasely-huawei' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PurchaselyHuawei = NativeModules.PurchaselyHuawei\n ? NativeModules.PurchaselyHuawei\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport function multiply(a: number, b: number): Promise<number> {\n return PurchaselyHuawei.multiply(a, b);\n}\n"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAMC,aAAa,GAChB,yFAAD,GACAD,QAAQ,CAACE,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,gBAAgB,GAAGN,aAAa,CAACM,gBAAd,GACrBN,aAAa,CAACM,gBADO,GAErB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUP,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,OAAO,SAASQ,QAAT,CAAkBC,CAAlB,EAA6BC,CAA7B,EAAyD;EAC9D,OAAON,gBAAgB,CAACI,QAAjB,CAA0BC,CAA1B,EAA6BC,CAA7B,CAAP;AACD"}
@@ -0,0 +1 @@
1
+ export declare function multiply(a: number, b: number): Promise<number>;
package/package.json ADDED
@@ -0,0 +1,148 @@
1
+ {
2
+ "name": "@purchasely/react-native-purchasely-huawei",
3
+ "version": "2.2.5",
4
+ "description": "Purchasely Huawei Mobile Services dependencies",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "react-native-purchasely-huawei.podspec",
17
+ "!lib/typescript/example",
18
+ "!android/build",
19
+ "!ios/build",
20
+ "!**/__tests__",
21
+ "!**/__fixtures__",
22
+ "!**/__mocks__"
23
+ ],
24
+ "scripts": {
25
+ "test": "jest",
26
+ "typescript": "tsc --noEmit",
27
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
28
+ "prepare": "bob build",
29
+ "release": "release-it",
30
+ "example": "yarn --cwd example",
31
+ "pods": "cd example && pod-install --quiet",
32
+ "bootstrap": "yarn example && yarn && yarn pods"
33
+ },
34
+ "keywords": [
35
+ "react-native",
36
+ "ios",
37
+ "android"
38
+ ],
39
+ "repository": "https://github.com/Purchasely/Purchasely-ReactNative/purchasely-huawei",
40
+ "author": "Purchasely <kevin@purchasely.com> (https://github.com/Purchasely/Purchasely-ReactNative)",
41
+ "license": "MIT",
42
+ "bugs": {
43
+ "url": "https://github.com/Purchasely/Purchasely-ReactNative/purchasely-huawei/issues"
44
+ },
45
+ "homepage": "https://github.com/Purchasely/Purchasely-ReactNative/purchasely-huawei#readme",
46
+ "publishConfig": {
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "devDependencies": {
50
+ "@commitlint/config-conventional": "^11.0.0",
51
+ "@react-native-community/eslint-config": "^2.0.0",
52
+ "@release-it/conventional-changelog": "^2.0.0",
53
+ "@types/jest": "^26.0.0",
54
+ "@types/react": "^16.9.19",
55
+ "@types/react-native": "0.62.13",
56
+ "commitlint": "^11.0.0",
57
+ "eslint": "^7.2.0",
58
+ "eslint-config-prettier": "^7.0.0",
59
+ "eslint-plugin-prettier": "^3.1.3",
60
+ "husky": "^6.0.0",
61
+ "jest": "^26.0.1",
62
+ "pod-install": "^0.1.0",
63
+ "prettier": "^2.0.5",
64
+ "react": "16.13.1",
65
+ "react-native": "0.63.4",
66
+ "react-native-builder-bob": "^0.18.2",
67
+ "release-it": "^14.2.2",
68
+ "typescript": "^4.1.3"
69
+ },
70
+ "peerDependencies": {
71
+ "react-native-purchasely": "2.2.5",
72
+ "react": "*",
73
+ "react-native": "*"
74
+ },
75
+ "jest": {
76
+ "preset": "react-native",
77
+ "modulePathIgnorePatterns": [
78
+ "<rootDir>/example/node_modules",
79
+ "<rootDir>/lib/"
80
+ ]
81
+ },
82
+ "commitlint": {
83
+ "extends": [
84
+ "@commitlint/config-conventional"
85
+ ]
86
+ },
87
+ "release-it": {
88
+ "git": {
89
+ "commitMessage": "chore: release ${version}",
90
+ "tagName": "v${version}"
91
+ },
92
+ "npm": {
93
+ "publish": true
94
+ },
95
+ "github": {
96
+ "release": true
97
+ },
98
+ "plugins": {
99
+ "@release-it/conventional-changelog": {
100
+ "preset": "angular"
101
+ }
102
+ }
103
+ },
104
+ "eslintConfig": {
105
+ "root": true,
106
+ "extends": [
107
+ "@react-native-community",
108
+ "prettier"
109
+ ],
110
+ "rules": {
111
+ "prettier/prettier": [
112
+ "error",
113
+ {
114
+ "quoteProps": "consistent",
115
+ "singleQuote": true,
116
+ "tabWidth": 2,
117
+ "trailingComma": "es5",
118
+ "useTabs": false
119
+ }
120
+ ]
121
+ }
122
+ },
123
+ "eslintIgnore": [
124
+ "node_modules/",
125
+ "lib/"
126
+ ],
127
+ "prettier": {
128
+ "quoteProps": "consistent",
129
+ "singleQuote": true,
130
+ "tabWidth": 2,
131
+ "trailingComma": "es5",
132
+ "useTabs": false
133
+ },
134
+ "react-native-builder-bob": {
135
+ "source": "src",
136
+ "output": "lib",
137
+ "targets": [
138
+ "commonjs",
139
+ "module",
140
+ [
141
+ "typescript",
142
+ {
143
+ "project": "tsconfig.build.json"
144
+ }
145
+ ]
146
+ ]
147
+ }
148
+ }
@@ -0,0 +1,19 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "react-native-purchasely-huawei"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "10.0" }
14
+ s.source = { :git => "https://github.com/Purchasely/Purchasely-ReactNative/purchasely-huawei.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+
18
+ s.dependency "React-Core"
19
+ end
package/src/index.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+
3
+ const LINKING_ERROR =
4
+ `The package 'react-native-purchasely-huawei' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo managed workflow\n';
8
+
9
+ const PurchaselyHuawei = NativeModules.PurchaselyHuawei
10
+ ? NativeModules.PurchaselyHuawei
11
+ : new Proxy(
12
+ {},
13
+ {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ },
17
+ }
18
+ );
19
+
20
+ export function multiply(a: number, b: number): Promise<number> {
21
+ return PurchaselyHuawei.multiply(a, b);
22
+ }