react-native-purchases 4.2.0 → 4.3.3
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/.classpath +6 -0
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +11 -1
- package/dist/errors.d.ts +4 -0
- package/dist/purchaserInfo.d.ts +2 -3
- package/dist/purchases.d.ts +33 -3
- package/dist/purchases.js +27 -2
- package/ios/RNPurchases.m +75 -82
- package/package.json +1 -1
- package/scripts/build.js +2 -2
- package/scripts/setupJest.js +2 -0
- package/CHANGELOG.md +0 -312
package/RNPurchases.podspec
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<classpath>
|
|
3
|
+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
|
|
4
|
+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
|
5
|
+
<classpathentry kind="output" path="bin/default"/>
|
|
6
|
+
</classpath>
|
package/android/.project
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<projectDescription>
|
|
3
|
+
<name>android</name>
|
|
4
|
+
<comment>Project ReactNativeSample-react-native-purchases created by Buildship.</comment>
|
|
5
|
+
<projects>
|
|
6
|
+
</projects>
|
|
7
|
+
<buildSpec>
|
|
8
|
+
<buildCommand>
|
|
9
|
+
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
10
|
+
<arguments>
|
|
11
|
+
</arguments>
|
|
12
|
+
</buildCommand>
|
|
13
|
+
<buildCommand>
|
|
14
|
+
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
15
|
+
<arguments>
|
|
16
|
+
</arguments>
|
|
17
|
+
</buildCommand>
|
|
18
|
+
</buildSpec>
|
|
19
|
+
<natures>
|
|
20
|
+
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
21
|
+
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
22
|
+
</natures>
|
|
23
|
+
<filteredResources>
|
|
24
|
+
<filter>
|
|
25
|
+
<id>0</id>
|
|
26
|
+
<name></name>
|
|
27
|
+
<type>30</type>
|
|
28
|
+
<matcher>
|
|
29
|
+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
|
30
|
+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
|
31
|
+
</matcher>
|
|
32
|
+
</filter>
|
|
33
|
+
</filteredResources>
|
|
34
|
+
</projectDescription>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
arguments=
|
|
2
|
+
auto.sync=false
|
|
3
|
+
build.scans.enabled=false
|
|
4
|
+
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
|
5
|
+
connection.project.dir=
|
|
6
|
+
eclipse.preferences.version=1
|
|
7
|
+
gradle.user.home=
|
|
8
|
+
java.home=/Users/cesardelavega/.sdkman/candidates/java/current
|
|
9
|
+
jvm.arguments=
|
|
10
|
+
offline.mode=false
|
|
11
|
+
override.workspace.settings=true
|
|
12
|
+
show.console.view=true
|
|
13
|
+
show.executions.view=true
|
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.
|
|
32
|
+
versionName '4.3.3'
|
|
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:1.
|
|
125
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:1.9.3'
|
|
126
126
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
127
127
|
}
|
|
@@ -43,7 +43,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
43
43
|
|
|
44
44
|
private static final String PURCHASER_INFO_UPDATED = "Purchases-PurchaserInfoUpdated";
|
|
45
45
|
public static final String PLATFORM_NAME = "react-native";
|
|
46
|
-
public static final String PLUGIN_VERSION = "4.
|
|
46
|
+
public static final String PLUGIN_VERSION = "4.3.3";
|
|
47
47
|
|
|
48
48
|
private final ReactApplicationContext reactContext;
|
|
49
49
|
|
|
@@ -158,6 +158,16 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
|
|
|
158
158
|
CommonKt.restoreTransactions(getOnResult(promise));
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
@ReactMethod
|
|
162
|
+
public void logOut(final Promise promise) {
|
|
163
|
+
CommonKt.logOut(getOnResult(promise));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@ReactMethod
|
|
167
|
+
public void logIn(String appUserID, final Promise promise) {
|
|
168
|
+
CommonKt.logIn(appUserID, getOnResult(promise));
|
|
169
|
+
}
|
|
170
|
+
|
|
161
171
|
@ReactMethod
|
|
162
172
|
public void reset(final Promise promise) {
|
|
163
173
|
CommonKt.reset(getOnResult(promise));
|
package/dist/errors.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ export interface PurchasesError {
|
|
|
27
27
|
code: PURCHASES_ERROR_CODE;
|
|
28
28
|
message: string;
|
|
29
29
|
readableErrorCode: string;
|
|
30
|
+
userInfo: ErrorInfo;
|
|
30
31
|
underlyingErrorMessage: string;
|
|
31
32
|
userCancelled: boolean | null;
|
|
32
33
|
}
|
|
34
|
+
export interface ErrorInfo {
|
|
35
|
+
readableErrorCode: string;
|
|
36
|
+
}
|
package/dist/purchaserInfo.d.ts
CHANGED
|
@@ -33,10 +33,9 @@ export interface PurchasesEntitlementInfo {
|
|
|
33
33
|
*/
|
|
34
34
|
readonly expirationDate: string | null;
|
|
35
35
|
/**
|
|
36
|
-
* The store where this entitlement was unlocked from.
|
|
37
|
-
* promotional, unknownStore
|
|
36
|
+
* The store where this entitlement was unlocked from.
|
|
38
37
|
*/
|
|
39
|
-
readonly store:
|
|
38
|
+
readonly store: "PLAY_STORE" | "APP_STORE" | "STRIPE" | "MAC_APP_STORE" | "PROMOTIONAL" | "AMAZON" | "UNKNOWN_STORE";
|
|
40
39
|
/**
|
|
41
40
|
* The product identifier that unlocked this entitlement
|
|
42
41
|
*/
|
package/dist/purchases.d.ts
CHANGED
|
@@ -57,6 +57,19 @@ export declare enum BILLING_FEATURE {
|
|
|
57
57
|
*/
|
|
58
58
|
PRICE_CHANGE_CONFIRMATION = 4
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Holds the logIn result
|
|
62
|
+
*/
|
|
63
|
+
export interface LogInResult {
|
|
64
|
+
/**
|
|
65
|
+
* The Purchaser Info for the user.
|
|
66
|
+
*/
|
|
67
|
+
readonly purchaserInfo: PurchaserInfo;
|
|
68
|
+
/**
|
|
69
|
+
* True if the call resulted in a new user getting created in the RevenueCat backend.
|
|
70
|
+
*/
|
|
71
|
+
readonly created: boolean;
|
|
72
|
+
}
|
|
60
73
|
export default class Purchases {
|
|
61
74
|
/**
|
|
62
75
|
* Enum for attribution networks
|
|
@@ -121,9 +134,10 @@ export default class Purchases {
|
|
|
121
134
|
*/
|
|
122
135
|
static setup(apiKey: string, appUserID?: string | null, observerMode?: boolean, userDefaultsSuiteName?: string): void;
|
|
123
136
|
/**
|
|
124
|
-
* @
|
|
137
|
+
* @deprecated, configure behavior through the RevenueCat dashboard instead.
|
|
125
138
|
* If an user tries to purchase a product that is active on the current app store account, we will treat it as a restore and alias
|
|
126
139
|
* the new ID with the previous id.
|
|
140
|
+
* @param {boolean} allowSharing Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
|
|
127
141
|
*/
|
|
128
142
|
static setAllowSharingStoreAccount(allowSharing: boolean): void;
|
|
129
143
|
/**
|
|
@@ -241,18 +255,34 @@ export default class Purchases {
|
|
|
241
255
|
*/
|
|
242
256
|
static getAppUserID(): string;
|
|
243
257
|
/**
|
|
258
|
+
* This function will logIn the current user with an appUserID. Typically this would be used after a log in
|
|
259
|
+
* to identify a user without calling configure.
|
|
260
|
+
* @param {String} appUserID The appUserID that should be linked to the currently user
|
|
261
|
+
* @returns {Promise<LogInResult>} A promise of an object that contains the purchaserInfo after logging in, as well as a boolean indicating
|
|
262
|
+
* whether the user has just been created for the first time in the RevenueCat backend.
|
|
263
|
+
*/
|
|
264
|
+
static logIn(appUserID: string): Promise<LogInResult>;
|
|
265
|
+
/**
|
|
266
|
+
* Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
267
|
+
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
268
|
+
*/
|
|
269
|
+
static logOut(): Promise<PurchaserInfo>;
|
|
270
|
+
/**
|
|
271
|
+
* @deprecated, use logIn instead.
|
|
244
272
|
* This function will alias two appUserIDs together.
|
|
245
273
|
* @param {String} newAppUserID The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
|
|
246
274
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
247
275
|
*/
|
|
248
276
|
static createAlias(newAppUserID: string): Promise<PurchaserInfo>;
|
|
249
277
|
/**
|
|
278
|
+
* @deprecated, use logIn instead.
|
|
250
279
|
* This function will identify the current user with an appUserID. Typically this would be used after a logout to identify a new user without calling configure
|
|
251
280
|
* @param {String} newAppUserID The appUserID that should be linked to the currently user
|
|
252
281
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
253
282
|
*/
|
|
254
283
|
static identify(newAppUserID: string): Promise<PurchaserInfo>;
|
|
255
284
|
/**
|
|
285
|
+
* @deprecated, use logOut instead.
|
|
256
286
|
* Resets the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
257
287
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
258
288
|
*/
|
|
@@ -280,9 +310,9 @@ export default class Purchases {
|
|
|
280
310
|
*/
|
|
281
311
|
static setAutomaticAppleSearchAdsAttributionCollection(enabled: boolean): void;
|
|
282
312
|
/**
|
|
283
|
-
* @returns { boolean } If the `appUserID` has been generated by RevenueCat or not.
|
|
313
|
+
* @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.
|
|
284
314
|
*/
|
|
285
|
-
static isAnonymous(): boolean
|
|
315
|
+
static isAnonymous(): Promise<boolean>;
|
|
286
316
|
/**
|
|
287
317
|
* iOS only. Computes whether or not a user is eligible for the introductory pricing period of a given product.
|
|
288
318
|
* You should use this method to determine whether or not you show the user the normal product price or the
|
package/dist/purchases.js
CHANGED
|
@@ -86,9 +86,10 @@ var Purchases = /** @class */ (function () {
|
|
|
86
86
|
RNPurchases.setupPurchases(apiKey, appUserID, observerMode, userDefaultsSuiteName);
|
|
87
87
|
};
|
|
88
88
|
/**
|
|
89
|
-
* @
|
|
89
|
+
* @deprecated, configure behavior through the RevenueCat dashboard instead.
|
|
90
90
|
* If an user tries to purchase a product that is active on the current app store account, we will treat it as a restore and alias
|
|
91
91
|
* the new ID with the previous id.
|
|
92
|
+
* @param {boolean} allowSharing Set this to true if you are passing in an appUserID but it is anonymous, this is true by default if you didn't pass an appUserID
|
|
92
93
|
*/
|
|
93
94
|
Purchases.setAllowSharingStoreAccount = function (allowSharing) {
|
|
94
95
|
RNPurchases.setAllowSharingStoreAccount(allowSharing);
|
|
@@ -272,6 +273,28 @@ var Purchases = /** @class */ (function () {
|
|
|
272
273
|
return RNPurchases.getAppUserID();
|
|
273
274
|
};
|
|
274
275
|
/**
|
|
276
|
+
* This function will logIn the current user with an appUserID. Typically this would be used after a log in
|
|
277
|
+
* to identify a user without calling configure.
|
|
278
|
+
* @param {String} appUserID The appUserID that should be linked to the currently user
|
|
279
|
+
* @returns {Promise<LogInResult>} A promise of an object that contains the purchaserInfo after logging in, as well as a boolean indicating
|
|
280
|
+
* whether the user has just been created for the first time in the RevenueCat backend.
|
|
281
|
+
*/
|
|
282
|
+
Purchases.logIn = function (appUserID) {
|
|
283
|
+
// noinspection SuspiciousTypeOfGuard
|
|
284
|
+
if (typeof appUserID !== "string") {
|
|
285
|
+
throw new Error("appUserID needs to be a string");
|
|
286
|
+
}
|
|
287
|
+
return RNPurchases.logIn(appUserID);
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
291
|
+
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
292
|
+
*/
|
|
293
|
+
Purchases.logOut = function () {
|
|
294
|
+
return RNPurchases.logOut();
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* @deprecated, use logIn instead.
|
|
275
298
|
* This function will alias two appUserIDs together.
|
|
276
299
|
* @param {String} newAppUserID The new appUserID that should be linked to the currently identified appUserID. Needs to be a string.
|
|
277
300
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
@@ -284,6 +307,7 @@ var Purchases = /** @class */ (function () {
|
|
|
284
307
|
return RNPurchases.createAlias(newAppUserID);
|
|
285
308
|
};
|
|
286
309
|
/**
|
|
310
|
+
* @deprecated, use logIn instead.
|
|
287
311
|
* This function will identify the current user with an appUserID. Typically this would be used after a logout to identify a new user without calling configure
|
|
288
312
|
* @param {String} newAppUserID The appUserID that should be linked to the currently user
|
|
289
313
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
@@ -296,6 +320,7 @@ var Purchases = /** @class */ (function () {
|
|
|
296
320
|
return RNPurchases.identify(newAppUserID);
|
|
297
321
|
};
|
|
298
322
|
/**
|
|
323
|
+
* @deprecated, use logOut instead.
|
|
299
324
|
* Resets the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
300
325
|
* @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a userInfo object with more information.
|
|
301
326
|
*/
|
|
@@ -335,7 +360,7 @@ var Purchases = /** @class */ (function () {
|
|
|
335
360
|
}
|
|
336
361
|
};
|
|
337
362
|
/**
|
|
338
|
-
* @returns { boolean } If the `appUserID` has been generated by RevenueCat or not.
|
|
363
|
+
* @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.
|
|
339
364
|
*/
|
|
340
365
|
Purchases.isAnonymous = function () {
|
|
341
366
|
return RNPurchases.isAnonymous();
|
package/ios/RNPurchases.m
CHANGED
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
|
|
12
12
|
@interface RNPurchases () <RCPurchasesDelegate>
|
|
13
13
|
|
|
14
|
-
@property(nonatomic, retain) NSMutableArray<RCDeferredPromotionalPurchaseBlock> *defermentBlocks;
|
|
14
|
+
@property (nonatomic, retain) NSMutableArray<RCDeferredPromotionalPurchaseBlock> *defermentBlocks;
|
|
15
15
|
|
|
16
16
|
@end
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
NSString *RNPurchasesPurchaserInfoUpdatedEvent = @"Purchases-PurchaserInfoUpdated";
|
|
19
20
|
NSString *RNPurchasesShouldPurchasePromoProductEvent = @"Purchases-ShouldPurchasePromoProduct";
|
|
20
21
|
|
|
22
|
+
|
|
21
23
|
@implementation RNPurchases
|
|
22
24
|
|
|
23
|
-
- (dispatch_queue_t)methodQueue
|
|
24
|
-
{
|
|
25
|
+
- (dispatch_queue_t)methodQueue {
|
|
25
26
|
return dispatch_get_main_queue();
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
- (NSArray<NSString *> *)supportedEvents
|
|
29
|
-
{
|
|
29
|
+
- (NSArray<NSString *> *)supportedEvents {
|
|
30
30
|
return @[RNPurchasesPurchaserInfoUpdatedEvent, RNPurchasesShouldPurchasePromoProductEvent];
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -35,8 +35,7 @@ RCT_EXPORT_MODULE();
|
|
|
35
35
|
RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
36
36
|
appUserID:(nullable NSString *)appUserID
|
|
37
37
|
observerMode:(BOOL)observerMode
|
|
38
|
-
userDefaultsSuiteName:(nullable NSString *)userDefaultsSuiteName)
|
|
39
|
-
{
|
|
38
|
+
userDefaultsSuiteName:(nullable NSString *)userDefaultsSuiteName) {
|
|
40
39
|
[RCPurchases configureWithAPIKey:apiKey
|
|
41
40
|
appUserID:appUserID
|
|
42
41
|
observerMode:observerMode
|
|
@@ -47,20 +46,20 @@ RCT_EXPORT_METHOD(setupPurchases:(NSString *)apiKey
|
|
|
47
46
|
[RCCommonFunctionality configure];
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
RCT_EXPORT_METHOD(setAllowSharingStoreAccount:(BOOL)allowSharingStoreAccount)
|
|
51
|
-
|
|
49
|
+
RCT_EXPORT_METHOD(setAllowSharingStoreAccount:(BOOL)allowSharingStoreAccount) {
|
|
50
|
+
#pragma GCC diagnostic push
|
|
51
|
+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
52
52
|
[RCCommonFunctionality setAllowSharingStoreAccount:allowSharingStoreAccount];
|
|
53
|
+
#pragma GCC diagnostic pop
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
RCT_EXPORT_METHOD(setFinishTransactions:(BOOL)finishTransactions)
|
|
56
|
-
{
|
|
56
|
+
RCT_EXPORT_METHOD(setFinishTransactions:(BOOL)finishTransactions) {
|
|
57
57
|
[RCCommonFunctionality setFinishTransactions:finishTransactions];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
RCT_EXPORT_METHOD(addAttributionData:(NSDictionary *)data
|
|
61
61
|
forNetwork:(NSInteger)network
|
|
62
|
-
forNetworkUserId:(nullable NSString *)networkUserId)
|
|
63
|
-
{
|
|
62
|
+
forNetworkUserId:(nullable NSString *)networkUserId) {
|
|
64
63
|
#pragma GCC diagnostic push
|
|
65
64
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
66
65
|
[RCCommonFunctionality addAttributionData:data network:network networkUserId:networkUserId];
|
|
@@ -69,16 +68,15 @@ RCT_EXPORT_METHOD(addAttributionData:(NSDictionary *)data
|
|
|
69
68
|
|
|
70
69
|
RCT_REMAP_METHOD(getOfferings,
|
|
71
70
|
getOfferingsWithResolve:(RCTPromiseResolveBlock)resolve
|
|
72
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
72
|
+
[RCCommonFunctionality getOfferingsWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
73
|
+
reject:reject]];
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
RCT_EXPORT_METHOD(getProductInfo:(NSArray *)products
|
|
78
77
|
type:(NSString *)type
|
|
79
78
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
80
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
81
|
-
{
|
|
79
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
82
80
|
[RCCommonFunctionality getProductInfo:products completionBlock:^(NSArray<NSDictionary *> *productObjects) {
|
|
83
81
|
resolve(productObjects);
|
|
84
82
|
}];
|
|
@@ -90,8 +88,7 @@ RCT_REMAP_METHOD(purchaseProduct,
|
|
|
90
88
|
type:(NSString *)type
|
|
91
89
|
signedDiscountTimestamp:(NSString *)signedDiscountTimestamp
|
|
92
90
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
93
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
94
|
-
{
|
|
91
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
95
92
|
[RCCommonFunctionality purchaseProduct:productIdentifier
|
|
96
93
|
signedDiscountTimestamp:signedDiscountTimestamp
|
|
97
94
|
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
@@ -104,8 +101,7 @@ RCT_REMAP_METHOD(purchasePackage,
|
|
|
104
101
|
upgradeInfo:(NSDictionary *)upgradeInfo
|
|
105
102
|
signedDiscountTimestamp:(NSString *)signedDiscountTimestamp
|
|
106
103
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
107
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
108
|
-
{
|
|
104
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
109
105
|
[RCCommonFunctionality purchasePackage:packageIdentifier
|
|
110
106
|
offering:offeringIdentifier
|
|
111
107
|
signedDiscountTimestamp:signedDiscountTimestamp
|
|
@@ -115,7 +111,8 @@ RCT_REMAP_METHOD(purchasePackage,
|
|
|
115
111
|
RCT_REMAP_METHOD(restoreTransactions,
|
|
116
112
|
restoreTransactionsWithResolve:(RCTPromiseResolveBlock)resolve
|
|
117
113
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
118
|
-
[RCCommonFunctionality restoreTransactionsWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
114
|
+
[RCCommonFunctionality restoreTransactionsWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
115
|
+
reject:reject]];
|
|
119
116
|
}
|
|
120
117
|
|
|
121
118
|
RCT_EXPORT_METHOD(syncPurchases) {
|
|
@@ -124,30 +121,47 @@ RCT_EXPORT_METHOD(syncPurchases) {
|
|
|
124
121
|
|
|
125
122
|
RCT_REMAP_METHOD(getAppUserID,
|
|
126
123
|
getAppUserIDWithResolve:(RCTPromiseResolveBlock)resolve
|
|
127
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
128
|
-
{
|
|
124
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
129
125
|
resolve([RCCommonFunctionality appUserID]);
|
|
130
126
|
}
|
|
131
127
|
|
|
132
128
|
RCT_EXPORT_METHOD(createAlias:(nullable NSString *)newAppUserID
|
|
133
129
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
134
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
135
|
-
{
|
|
130
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
136
131
|
[RCCommonFunctionality createAlias:newAppUserID
|
|
137
132
|
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
138
133
|
}
|
|
139
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
|
+
|
|
140
148
|
RCT_EXPORT_METHOD(identify:(nullable NSString *)appUserID
|
|
141
149
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
142
150
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
151
|
+
#pragma GCC diagnostic push
|
|
152
|
+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
143
153
|
[RCCommonFunctionality identify:appUserID
|
|
144
154
|
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
155
|
+
#pragma GCC diagnostic pop
|
|
145
156
|
}
|
|
146
157
|
|
|
147
158
|
RCT_REMAP_METHOD(reset,
|
|
148
159
|
resetWithResolve:(RCTPromiseResolveBlock)resolve
|
|
149
160
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
161
|
+
#pragma GCC diagnostic push
|
|
162
|
+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
150
163
|
[RCCommonFunctionality resetWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
164
|
+
#pragma GCC diagnostic pop
|
|
151
165
|
}
|
|
152
166
|
|
|
153
167
|
RCT_REMAP_METHOD(setDebugLogsEnabled,
|
|
@@ -173,15 +187,13 @@ RCT_EXPORT_METHOD(setAutomaticAppleSearchAdsAttributionCollection:(BOOL)automati
|
|
|
173
187
|
|
|
174
188
|
RCT_REMAP_METHOD(isAnonymous,
|
|
175
189
|
isAnonymousWithResolve:(RCTPromiseResolveBlock)resolve
|
|
176
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
177
|
-
{
|
|
190
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
178
191
|
resolve(@([RCCommonFunctionality isAnonymous]));
|
|
179
192
|
}
|
|
180
193
|
|
|
181
194
|
RCT_EXPORT_METHOD(makeDeferredPurchase:(nonnull NSNumber *)callbackID
|
|
182
195
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
183
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
184
|
-
{
|
|
196
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
185
197
|
RCDeferredPromotionalPurchaseBlock defermentBlock = [self.defermentBlocks objectAtIndex:[callbackID integerValue]];
|
|
186
198
|
[RCCommonFunctionality makeDeferredPurchase:defermentBlock
|
|
187
199
|
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
@@ -189,8 +201,7 @@ RCT_EXPORT_METHOD(makeDeferredPurchase:(nonnull NSNumber *)callbackID
|
|
|
189
201
|
|
|
190
202
|
RCT_EXPORT_METHOD(checkTrialOrIntroductoryPriceEligibility:(NSArray *)products
|
|
191
203
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
192
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
193
|
-
{
|
|
204
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
194
205
|
[RCCommonFunctionality checkTrialOrIntroductoryPriceEligibility:products
|
|
195
206
|
completionBlock:^(NSDictionary<NSString *,RCIntroEligibility *> * _Nonnull responseDictionary) {
|
|
196
207
|
resolve([NSDictionary dictionaryWithDictionary:responseDictionary]);
|
|
@@ -201,20 +212,18 @@ RCT_REMAP_METHOD(getPaymentDiscount,
|
|
|
201
212
|
getPaymentDiscountForProductIdentifier:(NSString *)productIdentifier
|
|
202
213
|
discountIdentifier:(nullable NSString *)discountIdentifier
|
|
203
214
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
204
|
-
reject:(RCTPromiseRejectBlock)reject)
|
|
205
|
-
{
|
|
215
|
+
reject:(RCTPromiseRejectBlock)reject) {
|
|
206
216
|
[RCCommonFunctionality paymentDiscountForProductIdentifier:productIdentifier
|
|
207
217
|
discount:discountIdentifier
|
|
208
|
-
completionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
218
|
+
completionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
219
|
+
reject:reject]];
|
|
209
220
|
}
|
|
210
221
|
|
|
211
|
-
RCT_EXPORT_METHOD(invalidatePurchaserInfoCache)
|
|
212
|
-
{
|
|
222
|
+
RCT_EXPORT_METHOD(invalidatePurchaserInfoCache) {
|
|
213
223
|
[RCCommonFunctionality invalidatePurchaserInfoCache];
|
|
214
224
|
}
|
|
215
225
|
|
|
216
|
-
RCT_EXPORT_METHOD(presentCodeRedemptionSheet)
|
|
217
|
-
{
|
|
226
|
+
RCT_EXPORT_METHOD(presentCodeRedemptionSheet) {
|
|
218
227
|
if (@available(iOS 14.0, *)) {
|
|
219
228
|
[RCCommonFunctionality presentCodeRedemptionSheet];
|
|
220
229
|
} else {
|
|
@@ -224,97 +233,79 @@ RCT_EXPORT_METHOD(presentCodeRedemptionSheet)
|
|
|
224
233
|
|
|
225
234
|
#pragma mark - Subscriber Attributes
|
|
226
235
|
|
|
227
|
-
RCT_EXPORT_METHOD(setProxyURLString:(nullable NSString *)proxyURLString)
|
|
228
|
-
{
|
|
236
|
+
RCT_EXPORT_METHOD(setProxyURLString:(nullable NSString *)proxyURLString) {
|
|
229
237
|
[RCCommonFunctionality setProxyURLString:proxyURLString];
|
|
230
238
|
}
|
|
231
239
|
|
|
232
|
-
RCT_EXPORT_METHOD(setAttributes:(NSDictionary *)attributes)
|
|
233
|
-
{
|
|
240
|
+
RCT_EXPORT_METHOD(setAttributes:(NSDictionary *)attributes) {
|
|
234
241
|
[RCCommonFunctionality setAttributes:attributes];
|
|
235
242
|
}
|
|
236
243
|
|
|
237
|
-
RCT_EXPORT_METHOD(setEmail:(NSString *)email)
|
|
238
|
-
{
|
|
244
|
+
RCT_EXPORT_METHOD(setEmail:(NSString *)email) {
|
|
239
245
|
[RCCommonFunctionality setEmail:email];
|
|
240
246
|
}
|
|
241
247
|
|
|
242
|
-
RCT_EXPORT_METHOD(setPhoneNumber:(NSString *)phoneNumber)
|
|
243
|
-
{
|
|
248
|
+
RCT_EXPORT_METHOD(setPhoneNumber:(NSString *)phoneNumber) {
|
|
244
249
|
[RCCommonFunctionality setPhoneNumber:phoneNumber];
|
|
245
250
|
}
|
|
246
251
|
|
|
247
|
-
RCT_EXPORT_METHOD(setDisplayName:(NSString *)displayName)
|
|
248
|
-
{
|
|
252
|
+
RCT_EXPORT_METHOD(setDisplayName:(NSString *)displayName) {
|
|
249
253
|
[RCCommonFunctionality setDisplayName:displayName];
|
|
250
254
|
}
|
|
251
255
|
|
|
252
|
-
RCT_EXPORT_METHOD(setPushToken:(NSString *)pushToken)
|
|
253
|
-
{
|
|
256
|
+
RCT_EXPORT_METHOD(setPushToken:(NSString *)pushToken) {
|
|
254
257
|
[RCCommonFunctionality setPushToken:pushToken];
|
|
255
258
|
}
|
|
256
259
|
|
|
257
260
|
# pragma mark Attribution IDs
|
|
258
261
|
|
|
259
|
-
RCT_EXPORT_METHOD(collectDeviceIdentifiers)
|
|
260
|
-
{
|
|
262
|
+
RCT_EXPORT_METHOD(collectDeviceIdentifiers) {
|
|
261
263
|
[RCCommonFunctionality collectDeviceIdentifiers];
|
|
262
264
|
}
|
|
263
265
|
|
|
264
|
-
RCT_EXPORT_METHOD(setAdjustID:(NSString *)adjustID)
|
|
265
|
-
{
|
|
266
|
+
RCT_EXPORT_METHOD(setAdjustID:(NSString *)adjustID) {
|
|
266
267
|
[RCCommonFunctionality setAdjustID:adjustID];
|
|
267
268
|
}
|
|
268
269
|
|
|
269
|
-
RCT_EXPORT_METHOD(setAppsflyerID:(NSString *)appsflyerID)
|
|
270
|
-
{
|
|
270
|
+
RCT_EXPORT_METHOD(setAppsflyerID:(NSString *)appsflyerID) {
|
|
271
271
|
[RCCommonFunctionality setAppsflyerID:appsflyerID];
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
RCT_EXPORT_METHOD(setFBAnonymousID:(NSString *)fbAnonymousID)
|
|
275
|
-
{
|
|
274
|
+
RCT_EXPORT_METHOD(setFBAnonymousID:(NSString *)fbAnonymousID) {
|
|
276
275
|
[RCCommonFunctionality setFBAnonymousID:fbAnonymousID];
|
|
277
276
|
}
|
|
278
277
|
|
|
279
|
-
RCT_EXPORT_METHOD(setMparticleID:(NSString *)mparticleID)
|
|
280
|
-
{
|
|
278
|
+
RCT_EXPORT_METHOD(setMparticleID:(NSString *)mparticleID) {
|
|
281
279
|
[RCCommonFunctionality setMparticleID:mparticleID];
|
|
282
280
|
}
|
|
283
281
|
|
|
284
|
-
RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID)
|
|
285
|
-
{
|
|
282
|
+
RCT_EXPORT_METHOD(setOnesignalID:(NSString *)onesignalID) {
|
|
286
283
|
[RCCommonFunctionality setOnesignalID:onesignalID];
|
|
287
284
|
}
|
|
288
285
|
|
|
289
286
|
# pragma mark Campaign parameters
|
|
290
287
|
|
|
291
|
-
RCT_EXPORT_METHOD(setMediaSource:(NSString *)mediaSource)
|
|
292
|
-
{
|
|
288
|
+
RCT_EXPORT_METHOD(setMediaSource:(NSString *)mediaSource) {
|
|
293
289
|
[RCCommonFunctionality setMediaSource:mediaSource];
|
|
294
290
|
}
|
|
295
291
|
|
|
296
|
-
RCT_EXPORT_METHOD(setCampaign:(NSString *)campaign)
|
|
297
|
-
{
|
|
292
|
+
RCT_EXPORT_METHOD(setCampaign:(NSString *)campaign) {
|
|
298
293
|
[RCCommonFunctionality setCampaign:campaign];
|
|
299
294
|
}
|
|
300
295
|
|
|
301
|
-
RCT_EXPORT_METHOD(setAdGroup:(NSString *)adGroup)
|
|
302
|
-
{
|
|
296
|
+
RCT_EXPORT_METHOD(setAdGroup:(NSString *)adGroup) {
|
|
303
297
|
[RCCommonFunctionality setAdGroup:adGroup];
|
|
304
298
|
}
|
|
305
299
|
|
|
306
|
-
RCT_EXPORT_METHOD(setAd:(NSString *)ad)
|
|
307
|
-
{
|
|
300
|
+
RCT_EXPORT_METHOD(setAd:(NSString *)ad) {
|
|
308
301
|
[RCCommonFunctionality setAd:ad];
|
|
309
302
|
}
|
|
310
303
|
|
|
311
|
-
RCT_EXPORT_METHOD(setKeyword:(NSString *)keyword)
|
|
312
|
-
{
|
|
304
|
+
RCT_EXPORT_METHOD(setKeyword:(NSString *)keyword) {
|
|
313
305
|
[RCCommonFunctionality setKeyword:keyword];
|
|
314
306
|
}
|
|
315
307
|
|
|
316
|
-
RCT_EXPORT_METHOD(setCreative:(NSString *)creative)
|
|
317
|
-
{
|
|
308
|
+
RCT_EXPORT_METHOD(setCreative:(NSString *)creative) {
|
|
318
309
|
[RCCommonFunctionality setCreative:creative];
|
|
319
310
|
}
|
|
320
311
|
|
|
@@ -331,12 +322,14 @@ RCT_REMAP_METHOD(canMakePayments,
|
|
|
331
322
|
[self sendEventWithName:RNPurchasesPurchaserInfoUpdatedEvent body:purchaserInfo.dictionary];
|
|
332
323
|
}
|
|
333
324
|
|
|
334
|
-
- (void)purchases:(RCPurchases *)purchases
|
|
325
|
+
- (void) purchases:(RCPurchases *)purchases
|
|
326
|
+
shouldPurchasePromoProduct:(SKProduct *)product
|
|
327
|
+
defermentBlock:(RCDeferredPromotionalPurchaseBlock)makeDeferredPurchase {
|
|
335
328
|
if (!self.defermentBlocks) {
|
|
336
329
|
self.defermentBlocks = [NSMutableArray array];
|
|
337
330
|
}
|
|
338
331
|
[self.defermentBlocks addObject:makeDeferredPurchase];
|
|
339
|
-
NSInteger position = [self.defermentBlocks count]-1;
|
|
332
|
+
NSInteger position = [self.defermentBlocks count] - 1;
|
|
340
333
|
[self sendEventWithName:RNPurchasesShouldPurchasePromoProductEvent body:@{@"callbackID": @(position)}];
|
|
341
334
|
}
|
|
342
335
|
|
|
@@ -347,11 +340,11 @@ RCT_REMAP_METHOD(canMakePayments,
|
|
|
347
340
|
reject([NSString stringWithFormat: @"%ld", (long)error.code], error.localizedDescription, error);
|
|
348
341
|
}
|
|
349
342
|
|
|
350
|
-
- (void (^)(NSDictionary *, RCErrorContainer *))getResponseCompletionBlockWithResolve:(RCTPromiseResolveBlock)resolve
|
|
351
|
-
{
|
|
343
|
+
- (void (^)(NSDictionary *, RCErrorContainer *))getResponseCompletionBlockWithResolve:(RCTPromiseResolveBlock)resolve
|
|
344
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
352
345
|
return ^(NSDictionary *_Nullable responseDictionary, RCErrorContainer *_Nullable error) {
|
|
353
346
|
if (error) {
|
|
354
|
-
reject([NSString stringWithFormat
|
|
347
|
+
reject([NSString stringWithFormat:@"%ld", (long) error.code], error.message, error.error);
|
|
355
348
|
} else if (responseDictionary) {
|
|
356
349
|
resolve([NSDictionary dictionaryWithDictionary:responseDictionary]);
|
|
357
350
|
} else {
|
|
@@ -365,7 +358,7 @@ RCT_REMAP_METHOD(canMakePayments,
|
|
|
365
358
|
}
|
|
366
359
|
|
|
367
360
|
- (NSString *)platformFlavorVersion {
|
|
368
|
-
return @"4.
|
|
361
|
+
return @"4.3.3";
|
|
369
362
|
}
|
|
370
363
|
|
|
371
364
|
@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.
|
|
4
|
+
"version": "4.3.3",
|
|
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",
|
package/scripts/build.js
CHANGED
|
@@ -5,11 +5,11 @@ 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.12.8"
|
|
9
9
|
);
|
|
10
10
|
downloadProcess.stdout.pipe(process.stdout);
|
|
11
11
|
const downloadProcessCommon = exec(
|
|
12
|
-
"./scripts/download-purchases-common.sh 1.
|
|
12
|
+
"./scripts/download-purchases-common.sh 1.9.3"
|
|
13
13
|
);
|
|
14
14
|
downloadProcessCommon.stdout.pipe(process.stdout);
|
|
15
15
|
} else if (os.type() === "Windows_NT") {
|
package/scripts/setupJest.js
CHANGED
|
@@ -684,6 +684,8 @@ NativeModules.RNPurchases = {
|
|
|
684
684
|
identify: jest.fn(),
|
|
685
685
|
setDebugLogsEnabled: jest.fn(),
|
|
686
686
|
getPurchaserInfo: jest.fn(),
|
|
687
|
+
logIn: jest.fn(),
|
|
688
|
+
logOut: jest.fn(),
|
|
687
689
|
reset: jest.fn(),
|
|
688
690
|
syncPurchases: jest.fn(),
|
|
689
691
|
setFinishTransactions: jest.fn(),
|
package/CHANGELOG.md
DELETED
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
## 4.2.0
|
|
2
|
-
|
|
3
|
-
- Add canMakePayments method (https://github.com/RevenueCat/react-native-purchases/pull/244)
|
|
4
|
-
- Add PR template (https://github.com/RevenueCat/react-native-purchases/pull/263)
|
|
5
|
-
|
|
6
|
-
## 4.1.4
|
|
7
|
-
|
|
8
|
-
- Bumped purchases-hybrid-common to 1.7.1 in Android [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.7.1)
|
|
9
|
-
|
|
10
|
-
## 4.1.3
|
|
11
|
-
|
|
12
|
-
- Bumped purchases-hybrid-common to 1.7.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.7.1)
|
|
13
|
-
- Bumped purchases-android to 4.2.1 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/4.2.1)
|
|
14
|
-
|
|
15
|
-
## 4.1.2
|
|
16
|
-
|
|
17
|
-
- Fix wrong types specified in TypeScript
|
|
18
|
-
https://github.com/RevenueCat/react-native-purchases/pull/231
|
|
19
|
-
- Cleaned up directory structure
|
|
20
|
-
https://github.com/RevenueCat/react-native-purchases/pull/235
|
|
21
|
-
https://github.com/RevenueCat/react-native-purchases/pull/237
|
|
22
|
-
https://github.com/RevenueCat/react-native-purchases/pull/232
|
|
23
|
-
- Updated example apps dependencies
|
|
24
|
-
https://github.com/RevenueCat/react-native-purchases/pull/240
|
|
25
|
-
https://github.com/RevenueCat/react-native-purchases/pull/239
|
|
26
|
-
https://github.com/RevenueCat/react-native-purchases/pull/233
|
|
27
|
-
https://github.com/RevenueCat/react-native-purchases/pull/227
|
|
28
|
-
https://github.com/RevenueCat/react-native-purchases/pull/226
|
|
29
|
-
https://github.com/RevenueCat/react-native-purchases/pull/234
|
|
30
|
-
- Bumped purchases-hybrid-common to 1.6.3 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.6.3)
|
|
31
|
-
- Bumped purchases-ios to 3.11.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/3.11.1)
|
|
32
|
-
https://github.com/RevenueCat/react-native-purchases/pull/243
|
|
33
|
-
|
|
34
|
-
## 4.1.1
|
|
35
|
-
|
|
36
|
-
- Updated example app to the latest React-Native version
|
|
37
|
-
https://github.com/RevenueCat/react-native-purchases/pull/222
|
|
38
|
-
- Updated `y18n` version
|
|
39
|
-
https://github.com/RevenueCat/react-native-purchases/pull/227
|
|
40
|
-
https://github.com/RevenueCat/react-native-purchases/pull/226
|
|
41
|
-
- Bumped purchases-hybrid-common to 1.6.2 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.6.2)
|
|
42
|
-
- Bumped purchases-ios to 3.10.7 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/3.10.7)
|
|
43
|
-
- Bumped purchases-android to 4.0.5 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/4.0.5)
|
|
44
|
-
https://github.com/RevenueCat/react-native-purchases/pull/225
|
|
45
|
-
|
|
46
|
-
## 4.1.0
|
|
47
|
-
|
|
48
|
-
- Added a new sample project available at `/Examples/WeatherApp`
|
|
49
|
-
https://github.com/RevenueCat/react-native-purchases/pull/212
|
|
50
|
-
- iOS:
|
|
51
|
-
- Added a new method `setSimulatesAskToBuyInSandbox`, that allows developers to test deferred purchases easily.
|
|
52
|
-
- Bumped purchases-hybrid-common to 1.6.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.6.1)
|
|
53
|
-
- Bumped purchases-ios to 3.10.6 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/3.10.6)
|
|
54
|
-
- Bumped purchases-android to 4.0.4 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/4.0.4)
|
|
55
|
-
https://github.com/RevenueCat/react-native-purchases/pull/216
|
|
56
|
-
- Fixed issues with CI builds in Android
|
|
57
|
-
https://github.com/RevenueCat/react-native-purchases/pull/214
|
|
58
|
-
https://github.com/RevenueCat/react-native-purchases/pull/217
|
|
59
|
-
|
|
60
|
-
## 4.0.1
|
|
61
|
-
|
|
62
|
-
- Update npm description for better discoverability
|
|
63
|
-
https://github.com/RevenueCat/react-native-purchases/pull/207
|
|
64
|
-
|
|
65
|
-
## 4.0.0
|
|
66
|
-
|
|
67
|
-
- removes deprecated `makePurchase`, replaced by `purchaseProduct`
|
|
68
|
-
- iOS:
|
|
69
|
-
- added new method, `syncPurchases`, that enables syncing the purchases in the local receipt with the backend without risking a password prompt. The method was already available on Android.
|
|
70
|
-
- added a new method, `presentCodeRedemptionSheet`, for offer codes redemption.
|
|
71
|
-
- Updated `React` dependency to `React-Core` and set `DEFINES_MODULE` to fix issues when building in Xcode 12
|
|
72
|
-
- Bumped `purchases-hybrid-common` to 1.5.0 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.5.0)
|
|
73
|
-
- Bumped `purchases-ios` to 3.9.2 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.9.2)
|
|
74
|
-
- Bumped `purchases-android` to 4.0.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/4.0.1)
|
|
75
|
-
|
|
76
|
-
## 3.4.3
|
|
77
|
-
|
|
78
|
-
- Bumped common files to 1.4.5 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.4.5)
|
|
79
|
-
- Bumped iOS SDK to 3.7.5 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.7.5)
|
|
80
|
-
|
|
81
|
-
## 3.4.2
|
|
82
|
-
|
|
83
|
-
- Bumped common files to 1.4.4 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.4.4)
|
|
84
|
-
- Should include the following Android changes:
|
|
85
|
-
https://github.com/RevenueCat/purchases-android/releases/tag/3.5.2
|
|
86
|
-
https://github.com/RevenueCat/purchases-android/releases/tag/3.5.1
|
|
87
|
-
|
|
88
|
-
## 3.4.1
|
|
89
|
-
|
|
90
|
-
- Bumped common files to 1.4.3 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.4.3)
|
|
91
|
-
- Bumped iOS to 3.7.2 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.7.2)
|
|
92
|
-
|
|
93
|
-
## 3.4.0
|
|
94
|
-
|
|
95
|
-
- Removes usage of BuildConfig [#171](https://github.com/RevenueCat/react-native-purchases/pull/171)
|
|
96
|
-
- Bumped common files to 1.4.2 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.4.2)
|
|
97
|
-
- Bumped iOS to 3.7.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.7.1)
|
|
98
|
-
- Bumped Android to 3.5.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/tag/3.5.0)
|
|
99
|
-
- Added a new property `nonSubscriptionTransactions` in `PurchaserInfo` to better manage non-subscriptions
|
|
100
|
-
- Attribution V2:
|
|
101
|
-
- Deprecated addAttribution in favor of setAdjustId, setAppsflyerId, setFbAnonymousId, setMparticleId.
|
|
102
|
-
- Added support for OneSignal via setOnesignalId
|
|
103
|
-
- Added setMediaSource, setCampaign, setAdGroup, setAd, setKeyword, setCreative, and collectDeviceIdentifiers
|
|
104
|
-
|
|
105
|
-
## 3.3.3
|
|
106
|
-
|
|
107
|
-
- Removes usage of BuildConfig [#171](https://github.com/RevenueCat/react-native-purchases/pull/171)
|
|
108
|
-
- Bumped common files to 1.3.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.3.1)
|
|
109
|
-
- Bumped iOS to 3.5.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.5.1)
|
|
110
|
-
- Bumped Android to 3.3.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/tag/3.3.0)
|
|
111
|
-
|
|
112
|
-
## 3.3.2
|
|
113
|
-
|
|
114
|
-
- Fixes purchaseDiscountedPackage and purchaseDiscountedProduct [#167](https://github.com/RevenueCat/react-native-purchases/pull/167)
|
|
115
|
-
|
|
116
|
-
## 3.3.1
|
|
117
|
-
|
|
118
|
-
- Renames setProxyURLString with setProxyURL [#148](https://github.com/RevenueCat/react-native-purchases/pull/148)
|
|
119
|
-
- Adds instructions to include the PurchasesHybridCommon framework [#150](https://github.com/RevenueCat/react-native-purchases/pull/150)
|
|
120
|
-
|
|
121
|
-
## 3.3.0
|
|
122
|
-
|
|
123
|
-
- Bumped iOS to 3.4.0 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases)
|
|
124
|
-
- Bumped Android to 3.2.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases)
|
|
125
|
-
- Added managementURL to PurchaserInfo
|
|
126
|
-
- Added setProxyURLString
|
|
127
|
-
- Added originalPurchaseDate to PurchaserInfo
|
|
128
|
-
- Update invalidatePurchaserInfoCache docs [#137](https://github.com/RevenueCat/react-native-purchases/pull/137)
|
|
129
|
-
- Changes the way the common dependency is managed [#144](https://github.com/RevenueCat/react-native-purchases/pull/144) [#145](https://github.com/RevenueCat/react-native-purchases/pull/145)
|
|
130
|
-
- Adds new headers for platformFlavor and platformFlavorVersion
|
|
131
|
-
- Adds userDefaultsSuiteName as an option when setting up the SDK
|
|
132
|
-
|
|
133
|
-
## 3.2.0
|
|
134
|
-
|
|
135
|
-
- Adds Subscriber Attributes, which allow developers to store additional, structured information
|
|
136
|
-
for a user in RevenueCat. More info: https://docs.revenuecat.com/docs/user-attributes.
|
|
137
|
-
|
|
138
|
-
## 3.1.0
|
|
139
|
-
|
|
140
|
-
- Properly scope Android package [#114](https://github.com/RevenueCat/react-native-purchases/pull/114)
|
|
141
|
-
- ⚠️**IMPORTANT**⚠️: You might need to relink the plugin since the Android package name has changed. All references to `com.reactlibrary.RNPurchasesPackage` in the code should be replace with `com.revenuecat.purchases.react.RNPurchasesPackage`.
|
|
142
|
-
- Apply correct array notation: [type] to type[] [#117](https://github.com/RevenueCat/react-native-purchases/pull/117)
|
|
143
|
-
- Adds subscription offers support for iOS https://docs.revenuecat.com/docs/ios-subscription-offers
|
|
144
|
-
- Introductory Price is now an object inside the PurchasesProduct object
|
|
145
|
-
|
|
146
|
-
## 3.0.6
|
|
147
|
-
|
|
148
|
-
- Exports enums
|
|
149
|
-
|
|
150
|
-
## 3.0.5
|
|
151
|
-
|
|
152
|
-
- Exports interfaces and types
|
|
153
|
-
|
|
154
|
-
## 3.0.4
|
|
155
|
-
|
|
156
|
-
- Renames introEligibilityStatus to status in IntroEligibility
|
|
157
|
-
|
|
158
|
-
## 3.0.3
|
|
159
|
-
|
|
160
|
-
- Adds `Purchases.checkTrialOrIntroductoryPriceEligibility`. Note that Android always returns INTRO_ELIGIBILITY_STATUS_UNKNOWN.
|
|
161
|
-
- Updates iOS to 3.0.1 and Android to 3.0.4
|
|
162
|
-
|
|
163
|
-
## 3.0.2
|
|
164
|
-
|
|
165
|
-
- Adds `Purchases.addShouldPurchasePromoProduct` to be able to handle purchases started from the Apple App Store.
|
|
166
|
-
|
|
167
|
-
## 3.0.1
|
|
168
|
-
|
|
169
|
-
- Updates Android SDK to 3.0.3 which should fix issues with restores and syncs.
|
|
170
|
-
|
|
171
|
-
## 3.0.0
|
|
172
|
-
|
|
173
|
-
- Support for new Offerings system.
|
|
174
|
-
- Deprecates `makePurchase` methods. Replaces with `purchasePackage`
|
|
175
|
-
- Deprecates `getEntitlements` method. Replaces with `getOfferings`
|
|
176
|
-
- See our migration guide for more info: https://docs.revenuecat.com/v3.0/docs/offerings-migration
|
|
177
|
-
- Updates to BillingClient 2.0.3. If finishTransactions is set to false (or observerMode is true when configuring the SDK),
|
|
178
|
-
this SDK won't acknowledge any purchase and you have to do it yourself.
|
|
179
|
-
- Adds proration mode support on upgrades/downgrades
|
|
180
|
-
- Adds more PurchaserInfo missing properties. `activeEntitlements`, `expirationsForActiveEntitlements`
|
|
181
|
-
and `purchaseDatesForActiveEntitlements` have been removed from PurchaserInfo
|
|
182
|
-
- `intro_price`, `intro_price_period_number_of_units` and `intro_price_cycles` are a number now or null instead of empty
|
|
183
|
-
strings, `intro_price_period_unit` can also be null.
|
|
184
|
-
- Added Typescript types (#72)
|
|
185
|
-
- New identity changes:
|
|
186
|
-
- The .createAlias() method is no longer required, use .identify() instead
|
|
187
|
-
- .identify() will create an alias if being called from an anonymous ID generated by RevenueCat
|
|
188
|
-
- Added an isAnonymous property to Purchases.sharedInstance
|
|
189
|
-
- Improved offline use
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
## 2.4.1
|
|
193
|
-
|
|
194
|
-
- Fixes expirationDate in the EntitlementInfo object in iOS
|
|
195
|
-
|
|
196
|
-
## 2.4.0
|
|
197
|
-
|
|
198
|
-
- Deprecates activeEntitlements in PurchaserInfo and adds entitlements object to RCPurchaserInfo. For more info check out https://docs.revenuecat.com/docs/purchaserinfo
|
|
199
|
-
- Fixes trial info being lost in Android. Access intro_price in the product information to get information around the trial period.
|
|
200
|
-
- Fixes exception when trying to purchase a product that doesn't exist.
|
|
201
|
-
|
|
202
|
-
## 2.3.4
|
|
203
|
-
|
|
204
|
-
- Fixes permissions of install scripts
|
|
205
|
-
|
|
206
|
-
## 2.3.3
|
|
207
|
-
|
|
208
|
-
- Upgrades Android SDK to https://github.com/RevenueCat/purchases-android/releases/tag/2.3.1
|
|
209
|
-
|
|
210
|
-
## 2.3.2
|
|
211
|
-
|
|
212
|
-
- Fixes a bug when normalizing intro_price_period.
|
|
213
|
-
- **BREAKING_CHANGE** All `intro_price` related fields in the product are strings, or empty strings if inexistent, in both iOS and Android. There were some discrepancies between platforms released in https://github.com/RevenueCat/react-native-purchases/releases/tag/2.3.0.
|
|
214
|
-
|
|
215
|
-
## 2.3.1
|
|
216
|
-
|
|
217
|
-
- Upgrades iOS SDK to https://github.com/RevenueCat/purchases-ios/releases/tag/2.5.0
|
|
218
|
-
|
|
219
|
-
## 2.3.0
|
|
220
|
-
|
|
221
|
-
- Upgrades SDKs to iOS https://github.com/RevenueCat/purchases-ios/releases/tag/2.4.0 and Android to https://github.com/RevenueCat/purchases-android/releases/tag/2.3.0.
|
|
222
|
-
- Adds Facebook as supported attribution network.
|
|
223
|
-
- Adds automatic Apple Search Ads attribution collection. Disabled by default.
|
|
224
|
-
- Adds introductory pricing to the iOS product.
|
|
225
|
-
|
|
226
|
-
## 2.2.2
|
|
227
|
-
|
|
228
|
-
- Removes wrong import referring to support library instead of androidx.
|
|
229
|
-
|
|
230
|
-
## 2.2.1
|
|
231
|
-
|
|
232
|
-
- Removes console.log statement
|
|
233
|
-
|
|
234
|
-
## 2.2.0
|
|
235
|
-
|
|
236
|
-
- Updates iOS SDK to 2.3.0. Check out the changelog for a full list of changes https://github.com/RevenueCat/purchases-ios/releases/tag/2.3.0
|
|
237
|
-
- Updates Android SDK to 2.2.2. Check out the changelog for a full list of changes https://github.com/RevenueCat/purchases-android/releases/tag/2.2.2
|
|
238
|
-
- ** BREAKING CHANGE ** makePurchase parameter oldSKUs is not an array anymore, it only accepts a string now. This is due to changes in the BillingClient.
|
|
239
|
-
- AddAttributionData can be called before the SDK has been setup. A network user identifier can be send to the addAttribution function, replacing the previous rc_appsflyer_id parameter.
|
|
240
|
-
- Adds an optional configuration boolean observerMode. This will set the value of finishTransactions at configuration time.
|
|
241
|
-
|
|
242
|
-
### Android only:
|
|
243
|
-
|
|
244
|
-
- addAttribution will automatically add the rc_gps_adid parameter.
|
|
245
|
-
- ** ANDROID BREAKING CHANGE ** Call syncTransactions to send purchases information to RevenueCat after any restore or purchase if you are using the SDK in observerMode. See our guide on Migrating Subscriptions for more information on syncTransactions: https://docs.revenuecat.com/docs/migrating-existing-subscriptions
|
|
246
|
-
|
|
247
|
-
### iOS only
|
|
248
|
-
|
|
249
|
-
- addAttribution will automatically add the rc_idfa and rc_idfv parameters if the AdSupport and UIKit frameworks are included, respectively.
|
|
250
|
-
- Apple Search Ad attribution can be automatically collected by setting the automaticAttributionCollection boolean to true before the SDK is configured.
|
|
251
|
-
|
|
252
|
-
## 2.1.2
|
|
253
|
-
|
|
254
|
-
- Updates iOS SDK to 2.1.1
|
|
255
|
-
|
|
256
|
-
## 2.1.1
|
|
257
|
-
|
|
258
|
-
- If using an app ejected from Expo, the Android project wouldn't build since it couldn't find the react-native dependency. This release should fix it.
|
|
259
|
-
|
|
260
|
-
## 2.1.0
|
|
261
|
-
|
|
262
|
-
- Updates SDK versions to 2.1.0 to include new error handling
|
|
263
|
-
- **BREAKING CHANGE** errors now contain a `userInfo` object with the message, an underlying error and a readable error code. The error codes have completely changed too and updated to the SDK 2.1.0.
|
|
264
|
-
- Updates RN and React versions.
|
|
265
|
-
- Fixes Windows installation
|
|
266
|
-
|
|
267
|
-
## 2.0.0
|
|
268
|
-
|
|
269
|
-
- Updates native SDKs to versions iOS 2.0.0 and Android 2.0.1
|
|
270
|
-
- Checks that the user ID sent to setup, identify or create alias is actually a string #28
|
|
271
|
-
- BREAKING CHANGE restoreTransactions returns a promise, the RestoreTransactionsListener has been removed
|
|
272
|
-
- BREAKING CHANGE makePurchase returns a promise, the PurchaseListener has been removed
|
|
273
|
-
- BREAKING CHANGE PurchaserInfoListener has been replaced with PurchaserInfoUpdateListener and it now only sends a purchaser info object. This listener is used to listen to changes in the purchaser info.
|
|
274
|
-
- Added support for Tenjin
|
|
275
|
-
- BREAKING CHANGE When failure making a purchase, the productIdentifier of the failed purchase is not sent to the rejected promise. Before, the PurchaseListener received both productIdentifier and error objects.
|
|
276
|
-
- Added setDebugLogsEnabled to display debug logs.
|
|
277
|
-
- Added getPurchaserInfo function to get the latest purchaser info known by the SDK
|
|
278
|
-
|
|
279
|
-
## 1.5.4
|
|
280
|
-
|
|
281
|
-
- Removes unnecessary debugger statement https://github.com/RevenueCat/react-native-purchases/issues/47
|
|
282
|
-
- Runs Linter and prettifier
|
|
283
|
-
- Adds missing setup call in the example
|
|
284
|
-
|
|
285
|
-
## 1.5.3
|
|
286
|
-
|
|
287
|
-
- Fix android setup on a null appuserid
|
|
288
|
-
- Adds listener removal methods
|
|
289
|
-
|
|
290
|
-
## 1.5.2
|
|
291
|
-
|
|
292
|
-
- Changes setIsUsingAnonymousID to allowSharingStoreAccount
|
|
293
|
-
|
|
294
|
-
## 1.5.1
|
|
295
|
-
|
|
296
|
-
- Fixes compilation in iOS
|
|
297
|
-
|
|
298
|
-
## 1.5.0
|
|
299
|
-
|
|
300
|
-
- Adds create alias, identify and reset
|
|
301
|
-
|
|
302
|
-
## 1.4.4
|
|
303
|
-
|
|
304
|
-
- Fixes download script issue
|
|
305
|
-
|
|
306
|
-
## 1.4.3
|
|
307
|
-
|
|
308
|
-
- Fixes build issue on the Android bridge
|
|
309
|
-
|
|
310
|
-
## 1.4.2
|
|
311
|
-
|
|
312
|
-
- Adds requestDate to the purchaser info to avoid edge cases
|