react-native-purchases 4.5.1 → 4.5.2
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/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/build.gradle.bck +2 -2
- package/ios/RNPurchases.m +3 -2
- package/package.json +3 -3
- package/scripts/build.js +1 -1
- package/scripts/build.js.bck +19 -0
- package/ios/RNPurchases.m.bck +0 -374
package/RNPurchases.podspec
CHANGED
package/android/build.gradle
CHANGED
|
@@ -29,7 +29,7 @@ android {
|
|
|
29
29
|
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
30
30
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
31
31
|
versionCode 1
|
|
32
|
-
versionName '4.5.
|
|
32
|
+
versionName '4.5.2'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
buildTypes {
|
|
@@ -122,6 +122,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
122
122
|
dependencies {
|
|
123
123
|
//noinspection GradleDynamicVersion
|
|
124
124
|
api 'com.facebook.react:react-native:+'
|
|
125
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common:
|
|
125
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:2.0.1'
|
|
126
126
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
127
127
|
}
|
package/android/build.gradle.bck
CHANGED
|
@@ -29,7 +29,7 @@ android {
|
|
|
29
29
|
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
30
30
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
31
31
|
versionCode 1
|
|
32
|
-
versionName '4.5.
|
|
32
|
+
versionName '4.5.1'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
buildTypes {
|
|
@@ -122,6 +122,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
122
122
|
dependencies {
|
|
123
123
|
//noinspection GradleDynamicVersion
|
|
124
124
|
api 'com.facebook.react:react-native:+'
|
|
125
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common:
|
|
125
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:2.0.1'
|
|
126
126
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
127
127
|
}
|
package/ios/RNPurchases.m
CHANGED
|
@@ -41,7 +41,8 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
|
41
41
|
observerMode:observerMode
|
|
42
42
|
userDefaultsSuiteName:userDefaultsSuiteName
|
|
43
43
|
platformFlavor:self.platformFlavor
|
|
44
|
-
platformFlavorVersion:self.platformFlavorVersion
|
|
44
|
+
platformFlavorVersion:self.platformFlavorVersion
|
|
45
|
+
dangerousSettings:nil];
|
|
45
46
|
RCPurchases.sharedPurchases.delegate = self;
|
|
46
47
|
[RCCommonFunctionality configure];
|
|
47
48
|
}
|
|
@@ -368,7 +369,7 @@ shouldPurchasePromoProduct:(SKProduct *)product
|
|
|
368
369
|
}
|
|
369
370
|
|
|
370
371
|
- (NSString *)platformFlavorVersion {
|
|
371
|
-
return @"4.5.
|
|
372
|
+
return @"4.5.2";
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
@end
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-purchases",
|
|
3
3
|
"title": "React Native Purchases",
|
|
4
|
-
"version": "4.5.
|
|
4
|
+
"version": "4.5.2",
|
|
5
5
|
"description": "React Native in-app purchases and subscriptions made easy. Supports iOS and Android. ",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"test": "jest",
|
|
35
35
|
"tslint": "tslint -c tslint.json 'src/*.ts'",
|
|
36
36
|
"prepublish": "tsc",
|
|
37
|
-
"example": "yarn --cwd examples/purchaseTester",
|
|
38
|
-
"pods": "cd examples/purchaseTester && pod-install --quiet",
|
|
37
|
+
"example": "(yarn --cwd examples/purchaseTester) && (yarn --cwd examples/purchaseTesterTypescript)",
|
|
38
|
+
"pods": "(cd examples/purchaseTester && npx pod-install --quiet) && (cd examples/purchaseTesterTypescript && npx pod-install --quiet)",
|
|
39
39
|
"bootstrap": "yarn example && yarn && yarn pods"
|
|
40
40
|
},
|
|
41
41
|
"repository": {
|
package/scripts/build.js
CHANGED
|
@@ -5,7 +5,7 @@ if (os.type() === "Linux") {
|
|
|
5
5
|
console.log("Skipping iOS Dependencies");
|
|
6
6
|
} else if (os.type() === "Darwin") {
|
|
7
7
|
const downloadProcess = exec(
|
|
8
|
-
"./scripts/download-purchases-framework.sh 3.
|
|
8
|
+
"./scripts/download-purchases-framework.sh 3.14.1"
|
|
9
9
|
);
|
|
10
10
|
downloadProcess.stdout.pipe(process.stdout);
|
|
11
11
|
const downloadProcessCommon = exec(
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const {exec} = require("child_process");
|
|
2
|
+
const os = require("os");
|
|
3
|
+
|
|
4
|
+
if (os.type() === "Linux") {
|
|
5
|
+
console.log("Skipping iOS Dependencies");
|
|
6
|
+
} else if (os.type() === "Darwin") {
|
|
7
|
+
const downloadProcess = exec(
|
|
8
|
+
"./scripts/download-purchases-framework.sh 3.14.1"
|
|
9
|
+
);
|
|
10
|
+
downloadProcess.stdout.pipe(process.stdout);
|
|
11
|
+
const downloadProcessCommon = exec(
|
|
12
|
+
"./scripts/download-purchases-common.sh 1.11.1"
|
|
13
|
+
);
|
|
14
|
+
downloadProcessCommon.stdout.pipe(process.stdout);
|
|
15
|
+
} else if (os.type() === "Windows_NT") {
|
|
16
|
+
console.log("Skipping iOS Dependencies");
|
|
17
|
+
} else {
|
|
18
|
+
throw new Error(`Unsupported OS found: ${os.type()}`);
|
|
19
|
+
}
|
package/ios/RNPurchases.m.bck
DELETED
|
@@ -1,374 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
// Created by RevenueCat.
|
|
4
|
-
// Copyright © 2019 RevenueCat. All rights reserved.
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
#import "RNPurchases.h"
|
|
8
|
-
|
|
9
|
-
@import StoreKit;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@interface RNPurchases () <RCPurchasesDelegate>
|
|
13
|
-
|
|
14
|
-
@property (nonatomic, retain) NSMutableArray<RCDeferredPromotionalPurchaseBlock> *defermentBlocks;
|
|
15
|
-
|
|
16
|
-
@end
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
NSString *RNPurchasesPurchaserInfoUpdatedEvent = @"Purchases-PurchaserInfoUpdated";
|
|
20
|
-
NSString *RNPurchasesShouldPurchasePromoProductEvent = @"Purchases-ShouldPurchasePromoProduct";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@implementation RNPurchases
|
|
24
|
-
|
|
25
|
-
- (dispatch_queue_t)methodQueue {
|
|
26
|
-
return dispatch_get_main_queue();
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
- (NSArray<NSString *> *)supportedEvents {
|
|
30
|
-
return @[RNPurchasesPurchaserInfoUpdatedEvent, RNPurchasesShouldPurchasePromoProductEvent];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
RCT_EXPORT_MODULE();
|
|
34
|
-
|
|
35
|
-
RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
36
|
-
appUserID:(nullable NSString *)appUserID
|
|
37
|
-
observerMode:(BOOL)observerMode
|
|
38
|
-
userDefaultsSuiteName:(nullable NSString *)userDefaultsSuiteName) {
|
|
39
|
-
[RCPurchases configureWithAPIKey:apiKey
|
|
40
|
-
appUserID:appUserID
|
|
41
|
-
observerMode:observerMode
|
|
42
|
-
userDefaultsSuiteName:userDefaultsSuiteName
|
|
43
|
-
platformFlavor:self.platformFlavor
|
|
44
|
-
platformFlavorVersion:self.platformFlavorVersion];
|
|
45
|
-
RCPurchases.sharedPurchases.delegate = self;
|
|
46
|
-
[RCCommonFunctionality configure];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
RCT_EXPORT_METHOD(setAllowSharingStoreAccount:(BOOL)allowSharingStoreAccount) {
|
|
50
|
-
#pragma GCC diagnostic push
|
|
51
|
-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
52
|
-
[RCCommonFunctionality setAllowSharingStoreAccount:allowSharingStoreAccount];
|
|
53
|
-
#pragma GCC diagnostic pop
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
RCT_EXPORT_METHOD(setFinishTransactions:(BOOL)finishTransactions) {
|
|
57
|
-
[RCCommonFunctionality setFinishTransactions:finishTransactions];
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
RCT_EXPORT_METHOD(addAttributionData:(NSDictionary *)data
|
|
61
|
-
forNetwork:(NSInteger)network
|
|
62
|
-
forNetworkUserId:(nullable NSString *)networkUserId) {
|
|
63
|
-
#pragma GCC diagnostic push
|
|
64
|
-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
65
|
-
[RCCommonFunctionality addAttributionData:data network:network networkUserId:networkUserId];
|
|
66
|
-
#pragma GCC diagnostic pop
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
RCT_REMAP_METHOD(getOfferings,
|
|
70
|
-
getOfferingsWithResolve:(RCTPromiseResolveBlock)resolve
|
|
71
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
72
|
-
[RCCommonFunctionality getOfferingsWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
73
|
-
reject:reject]];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
RCT_EXPORT_METHOD(getProductInfo:(NSArray *)products
|
|
77
|
-
type:(NSString *)type
|
|
78
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
79
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
80
|
-
[RCCommonFunctionality getProductInfo:products completionBlock:^(NSArray<NSDictionary *> *productObjects) {
|
|
81
|
-
resolve(productObjects);
|
|
82
|
-
}];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
RCT_REMAP_METHOD(purchaseProduct,
|
|
86
|
-
purchaseProduct:(NSString *)productIdentifier
|
|
87
|
-
upgradeInfo:(NSDictionary *)upgradeInfo
|
|
88
|
-
type:(NSString *)type
|
|
89
|
-
signedDiscountTimestamp:(NSString *)signedDiscountTimestamp
|
|
90
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
91
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
92
|
-
[RCCommonFunctionality purchaseProduct:productIdentifier
|
|
93
|
-
signedDiscountTimestamp:signedDiscountTimestamp
|
|
94
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
RCT_REMAP_METHOD(purchasePackage,
|
|
99
|
-
purchasePackage:(NSString *)packageIdentifier
|
|
100
|
-
offeringIdentifier:(NSString *)offeringIdentifier
|
|
101
|
-
upgradeInfo:(NSDictionary *)upgradeInfo
|
|
102
|
-
signedDiscountTimestamp:(NSString *)signedDiscountTimestamp
|
|
103
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
104
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
105
|
-
[RCCommonFunctionality purchasePackage:packageIdentifier
|
|
106
|
-
offering:offeringIdentifier
|
|
107
|
-
signedDiscountTimestamp:signedDiscountTimestamp
|
|
108
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
RCT_REMAP_METHOD(restoreTransactions,
|
|
112
|
-
restoreTransactionsWithResolve:(RCTPromiseResolveBlock)resolve
|
|
113
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
114
|
-
[RCCommonFunctionality restoreTransactionsWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
115
|
-
reject:reject]];
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
RCT_EXPORT_METHOD(syncPurchases) {
|
|
119
|
-
[RCCommonFunctionality syncPurchasesWithCompletionBlock:nil];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
RCT_REMAP_METHOD(getAppUserID,
|
|
123
|
-
getAppUserIDWithResolve:(RCTPromiseResolveBlock)resolve
|
|
124
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
125
|
-
resolve([RCCommonFunctionality appUserID]);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
RCT_EXPORT_METHOD(createAlias:(nullable NSString *)newAppUserID
|
|
129
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
130
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
131
|
-
[RCCommonFunctionality createAlias:newAppUserID
|
|
132
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
RCT_EXPORT_METHOD(logIn:(nonnull NSString *)appUserID
|
|
136
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
137
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
138
|
-
[RCCommonFunctionality logInWithAppUserID:appUserID
|
|
139
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
RCT_REMAP_METHOD(logOut,
|
|
143
|
-
logOutWithResolve:(RCTPromiseResolveBlock)resolve
|
|
144
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
145
|
-
[RCCommonFunctionality logOutWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
RCT_EXPORT_METHOD(identify:(nullable NSString *)appUserID
|
|
149
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
150
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
151
|
-
#pragma GCC diagnostic push
|
|
152
|
-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
153
|
-
[RCCommonFunctionality identify:appUserID
|
|
154
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
155
|
-
#pragma GCC diagnostic pop
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
RCT_REMAP_METHOD(reset,
|
|
159
|
-
resetWithResolve:(RCTPromiseResolveBlock)resolve
|
|
160
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
161
|
-
#pragma GCC diagnostic push
|
|
162
|
-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
163
|
-
[RCCommonFunctionality resetWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
164
|
-
#pragma GCC diagnostic pop
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
RCT_REMAP_METHOD(setDebugLogsEnabled,
|
|
168
|
-
debugLogsEnabled:(BOOL)enabled) {
|
|
169
|
-
[RCCommonFunctionality setDebugLogsEnabled:enabled];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
RCT_EXPORT_METHOD(setSimulatesAskToBuyInSandbox:(BOOL)simulatesAskToBuyInSandbox)
|
|
173
|
-
{
|
|
174
|
-
[RCCommonFunctionality setSimulatesAskToBuyInSandbox:simulatesAskToBuyInSandbox];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
RCT_REMAP_METHOD(getPurchaserInfo,
|
|
178
|
-
purchaserInfoWithResolve:(RCTPromiseResolveBlock)resolve
|
|
179
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
180
|
-
[RCCommonFunctionality getPurchaserInfoWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
RCT_EXPORT_METHOD(setAutomaticAppleSearchAdsAttributionCollection:(BOOL)automaticAppleSearchAdsAttributionCollection)
|
|
184
|
-
{
|
|
185
|
-
[RCCommonFunctionality setAutomaticAppleSearchAdsAttributionCollection:automaticAppleSearchAdsAttributionCollection];
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
RCT_REMAP_METHOD(isAnonymous,
|
|
189
|
-
isAnonymousWithResolve:(RCTPromiseResolveBlock)resolve
|
|
190
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
191
|
-
resolve(@([RCCommonFunctionality isAnonymous]));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
RCT_EXPORT_METHOD(makeDeferredPurchase:(nonnull NSNumber *)callbackID
|
|
195
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
196
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
197
|
-
RCDeferredPromotionalPurchaseBlock defermentBlock = [self.defermentBlocks objectAtIndex:[callbackID integerValue]];
|
|
198
|
-
[RCCommonFunctionality makeDeferredPurchase:defermentBlock
|
|
199
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
RCT_EXPORT_METHOD(checkTrialOrIntroductoryPriceEligibility:(NSArray *)products
|
|
203
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
204
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
205
|
-
[RCCommonFunctionality checkTrialOrIntroductoryPriceEligibility:products
|
|
206
|
-
completionBlock:^(NSDictionary<NSString *,RCIntroEligibility *> * _Nonnull responseDictionary) {
|
|
207
|
-
resolve([NSDictionary dictionaryWithDictionary:responseDictionary]);
|
|
208
|
-
}];
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
RCT_REMAP_METHOD(getPaymentDiscount,
|
|
212
|
-
getPaymentDiscountForProductIdentifier:(NSString *)productIdentifier
|
|
213
|
-
discountIdentifier:(nullable NSString *)discountIdentifier
|
|
214
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
215
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
216
|
-
[RCCommonFunctionality paymentDiscountForProductIdentifier:productIdentifier
|
|
217
|
-
discount:discountIdentifier
|
|
218
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
219
|
-
reject:reject]];
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
RCT_EXPORT_METHOD(invalidatePurchaserInfoCache) {
|
|
223
|
-
[RCCommonFunctionality invalidatePurchaserInfoCache];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
RCT_EXPORT_METHOD(presentCodeRedemptionSheet) {
|
|
227
|
-
if (@available(iOS 14.0, *)) {
|
|
228
|
-
[RCCommonFunctionality presentCodeRedemptionSheet];
|
|
229
|
-
} else {
|
|
230
|
-
NSLog(@"[Purchases] Warning: tried to present codeRedemptionSheet, but it's only available on iOS 14.0 or greater.");
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
#pragma mark - Subscriber Attributes
|
|
235
|
-
|
|
236
|
-
RCT_EXPORT_METHOD(setProxyURLString:(nullable NSString *)proxyURLString) {
|
|
237
|
-
[RCCommonFunctionality setProxyURLString:proxyURLString];
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
RCT_EXPORT_METHOD(setAttributes:(NSDictionary *)attributes) {
|
|
241
|
-
[RCCommonFunctionality setAttributes:attributes];
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
RCT_EXPORT_METHOD(setEmail:(NSString *)email) {
|
|
245
|
-
[RCCommonFunctionality setEmail:email];
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
RCT_EXPORT_METHOD(setPhoneNumber:(NSString *)phoneNumber) {
|
|
249
|
-
[RCCommonFunctionality setPhoneNumber:phoneNumber];
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
RCT_EXPORT_METHOD(setDisplayName:(NSString *)displayName) {
|
|
253
|
-
[RCCommonFunctionality setDisplayName:displayName];
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
RCT_EXPORT_METHOD(setPushToken:(NSString *)pushToken) {
|
|
257
|
-
[RCCommonFunctionality setPushToken:pushToken];
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
# pragma mark Attribution IDs
|
|
261
|
-
|
|
262
|
-
RCT_EXPORT_METHOD(collectDeviceIdentifiers) {
|
|
263
|
-
[RCCommonFunctionality collectDeviceIdentifiers];
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
RCT_EXPORT_METHOD(setAdjustID:(NSString *)adjustID) {
|
|
267
|
-
[RCCommonFunctionality setAdjustID:adjustID];
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
RCT_EXPORT_METHOD(setAppsflyerID:(NSString *)appsflyerID) {
|
|
271
|
-
[RCCommonFunctionality setAppsflyerID:appsflyerID];
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
RCT_EXPORT_METHOD(setFBAnonymousID:(NSString *)fbAnonymousID) {
|
|
275
|
-
[RCCommonFunctionality setFBAnonymousID:fbAnonymousID];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
RCT_EXPORT_METHOD(setMparticleID:(NSString *)mparticleID) {
|
|
279
|
-
[RCCommonFunctionality setMparticleID:mparticleID];
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
|
|
283
|
-
[RCCommonFunctionality setOnesignalID:onesignalID];
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
RCT_EXPORT_METHOD(setAirshipChannelID:(NSString *)airshipChannelID) {
|
|
287
|
-
[RCCommonFunctionality setAirshipChannelID:airshipChannelID];
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
# pragma mark Campaign parameters
|
|
291
|
-
|
|
292
|
-
RCT_EXPORT_METHOD(setMediaSource:(NSString *)mediaSource) {
|
|
293
|
-
[RCCommonFunctionality setMediaSource:mediaSource];
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
RCT_EXPORT_METHOD(setCampaign:(NSString *)campaign) {
|
|
297
|
-
[RCCommonFunctionality setCampaign:campaign];
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
RCT_EXPORT_METHOD(setAdGroup:(NSString *)adGroup) {
|
|
301
|
-
[RCCommonFunctionality setAdGroup:adGroup];
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
RCT_EXPORT_METHOD(setAd:(NSString *)ad) {
|
|
305
|
-
[RCCommonFunctionality setAd:ad];
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
RCT_EXPORT_METHOD(setKeyword:(NSString *)keyword) {
|
|
309
|
-
[RCCommonFunctionality setKeyword:keyword];
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
RCT_EXPORT_METHOD(setCreative:(NSString *)creative) {
|
|
313
|
-
[RCCommonFunctionality setCreative:creative];
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
RCT_REMAP_METHOD(canMakePayments,
|
|
317
|
-
canMakePaymentsWithFeatures:(NSArray<NSNumber *> *)features
|
|
318
|
-
resolve:(RCTPromiseResolveBlock)resolve
|
|
319
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
320
|
-
resolve(@([RCCommonFunctionality canMakePaymentsWithFeatures:features]));
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
RCT_REMAP_METHOD(isConfigured,
|
|
324
|
-
isConfiguredWithResolve:(RCTPromiseResolveBlock)resolve
|
|
325
|
-
reject:(RCTPromiseRejectBlock)reject) {
|
|
326
|
-
resolve(@(RCPurchases.isConfigured));
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
#pragma mark -
|
|
330
|
-
#pragma mark Delegate Methods
|
|
331
|
-
- (void)purchases:(RCPurchases *)purchases didReceiveUpdatedPurchaserInfo:(RCPurchaserInfo *)purchaserInfo {
|
|
332
|
-
[self sendEventWithName:RNPurchasesPurchaserInfoUpdatedEvent body:purchaserInfo.dictionary];
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
- (void) purchases:(RCPurchases *)purchases
|
|
336
|
-
shouldPurchasePromoProduct:(SKProduct *)product
|
|
337
|
-
defermentBlock:(RCDeferredPromotionalPurchaseBlock)makeDeferredPurchase {
|
|
338
|
-
if (!self.defermentBlocks) {
|
|
339
|
-
self.defermentBlocks = [NSMutableArray array];
|
|
340
|
-
}
|
|
341
|
-
[self.defermentBlocks addObject:makeDeferredPurchase];
|
|
342
|
-
NSInteger position = [self.defermentBlocks count] - 1;
|
|
343
|
-
[self sendEventWithName:RNPurchasesShouldPurchasePromoProductEvent body:@{@"callbackID": @(position)}];
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
#pragma mark -
|
|
347
|
-
#pragma mark Helper Methods
|
|
348
|
-
|
|
349
|
-
- (void)rejectPromiseWithBlock:(RCTPromiseRejectBlock)reject error:(NSError *)error {
|
|
350
|
-
reject([NSString stringWithFormat: @"%ld", (long)error.code], error.localizedDescription, error);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
- (void (^)(NSDictionary *, RCErrorContainer *))getResponseCompletionBlockWithResolve:(RCTPromiseResolveBlock)resolve
|
|
354
|
-
reject:(RCTPromiseRejectBlock)reject {
|
|
355
|
-
return ^(NSDictionary *_Nullable responseDictionary, RCErrorContainer *_Nullable error) {
|
|
356
|
-
if (error) {
|
|
357
|
-
reject([NSString stringWithFormat:@"%ld", (long) error.code], error.message, error.error);
|
|
358
|
-
} else if (responseDictionary) {
|
|
359
|
-
resolve([NSDictionary dictionaryWithDictionary:responseDictionary]);
|
|
360
|
-
} else {
|
|
361
|
-
resolve(nil);
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
- (NSString *)platformFlavor {
|
|
367
|
-
return @"react-native";
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
- (NSString *)platformFlavorVersion {
|
|
371
|
-
return @"4.5.0";
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
@end
|