react-native-purchases 6.6.2 → 6.6.4
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/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +1 -1
- package/dist/customerInfo.d.ts +1 -158
- package/dist/customerInfo.js +16 -0
- package/dist/errors.d.ts +1 -60
- package/dist/errors.js +16 -86
- package/dist/offerings.d.ts +1 -533
- package/dist/offerings.js +16 -152
- package/dist/purchases.d.ts +2 -130
- package/dist/purchases.js +36 -96
- package/ios/RNPurchases.m +3 -2
- package/package.json +4 -1
- package/scripts/docs/index.html +1 -1
package/dist/purchases.d.ts
CHANGED
|
@@ -1,133 +1,5 @@
|
|
|
1
|
-
import { PURCHASES_ERROR_CODE, UninitializedPurchasesError, UnsupportedPlatformError } from
|
|
2
|
-
|
|
3
|
-
import { PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesStoreProduct, UpgradeInfo, PurchasesPromotionalOffer, PurchasesPackage, IntroEligibility, PurchasesStoreProductDiscount, SubscriptionOption, PRODUCT_CATEGORY, GoogleProductChangeInfo } from "./offerings";
|
|
4
|
-
/**
|
|
5
|
-
* Listener used on updated customer info
|
|
6
|
-
* @callback CustomerInfoUpdateListener
|
|
7
|
-
* @param {Object} customerInfo Object containing info for the customer
|
|
8
|
-
*/
|
|
9
|
-
export type CustomerInfoUpdateListener = (customerInfo: CustomerInfo) => void;
|
|
10
|
-
export type ShouldPurchasePromoProductListener = (deferredPurchase: () => Promise<MakePurchaseResult>) => void;
|
|
11
|
-
export type MakePurchaseResult = {
|
|
12
|
-
productIdentifier: string;
|
|
13
|
-
customerInfo: CustomerInfo;
|
|
14
|
-
};
|
|
15
|
-
export type LogHandler = (logLevel: LOG_LEVEL, message: string) => void;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated, use PRODUCT_CATEGORY
|
|
18
|
-
*/
|
|
19
|
-
export declare enum PURCHASE_TYPE {
|
|
20
|
-
/**
|
|
21
|
-
* A type of SKU for in-app products.
|
|
22
|
-
*/
|
|
23
|
-
INAPP = "inapp",
|
|
24
|
-
/**
|
|
25
|
-
* A type of SKU for subscriptions.
|
|
26
|
-
*/
|
|
27
|
-
SUBS = "subs"
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Enum for billing features.
|
|
31
|
-
* Currently, these are only relevant for Google Play Android users:
|
|
32
|
-
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
33
|
-
*/
|
|
34
|
-
export declare enum BILLING_FEATURE {
|
|
35
|
-
/**
|
|
36
|
-
* Purchase/query for subscriptions.
|
|
37
|
-
*/
|
|
38
|
-
SUBSCRIPTIONS = 0,
|
|
39
|
-
/**
|
|
40
|
-
* Subscriptions update/replace.
|
|
41
|
-
*/
|
|
42
|
-
SUBSCRIPTIONS_UPDATE = 1,
|
|
43
|
-
/**
|
|
44
|
-
* Purchase/query for in-app items on VR.
|
|
45
|
-
*/
|
|
46
|
-
IN_APP_ITEMS_ON_VR = 2,
|
|
47
|
-
/**
|
|
48
|
-
* Purchase/query for subscriptions on VR.
|
|
49
|
-
*/
|
|
50
|
-
SUBSCRIPTIONS_ON_VR = 3,
|
|
51
|
-
/**
|
|
52
|
-
* Launch a price change confirmation flow.
|
|
53
|
-
*/
|
|
54
|
-
PRICE_CHANGE_CONFIRMATION = 4
|
|
55
|
-
}
|
|
56
|
-
export declare enum REFUND_REQUEST_STATUS {
|
|
57
|
-
/**
|
|
58
|
-
* Apple has received the refund request.
|
|
59
|
-
*/
|
|
60
|
-
SUCCESS = 0,
|
|
61
|
-
/**
|
|
62
|
-
* User canceled submission of the refund request.
|
|
63
|
-
*/
|
|
64
|
-
USER_CANCELLED = 1,
|
|
65
|
-
/**
|
|
66
|
-
* There was an error with the request. See message for more details.
|
|
67
|
-
*/
|
|
68
|
-
ERROR = 2
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Holds the logIn result
|
|
72
|
-
*/
|
|
73
|
-
export interface LogInResult {
|
|
74
|
-
/**
|
|
75
|
-
* The Customer Info for the user.
|
|
76
|
-
*/
|
|
77
|
-
readonly customerInfo: CustomerInfo;
|
|
78
|
-
/**
|
|
79
|
-
* True if the call resulted in a new user getting created in the RevenueCat backend.
|
|
80
|
-
*/
|
|
81
|
-
readonly created: boolean;
|
|
82
|
-
}
|
|
83
|
-
export declare enum LOG_LEVEL {
|
|
84
|
-
VERBOSE = "VERBOSE",
|
|
85
|
-
DEBUG = "DEBUG",
|
|
86
|
-
INFO = "INFO",
|
|
87
|
-
WARN = "WARN",
|
|
88
|
-
ERROR = "ERROR"
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Holds parameters to initialize the SDK.
|
|
92
|
-
*/
|
|
93
|
-
export interface PurchasesConfiguration {
|
|
94
|
-
/**
|
|
95
|
-
* RevenueCat API Key. Needs to be a string
|
|
96
|
-
*/
|
|
97
|
-
apiKey: string;
|
|
98
|
-
/**
|
|
99
|
-
* A unique id for identifying the user
|
|
100
|
-
*/
|
|
101
|
-
appUserID?: string | null;
|
|
102
|
-
/**
|
|
103
|
-
* An optional boolean. Set this to TRUE if you have your own IAP implementation and
|
|
104
|
-
* want to use only RevenueCat's backend. Default is FALSE. If you are on Android and setting this to ON, you will have
|
|
105
|
-
* to acknowledge the purchases yourself.
|
|
106
|
-
*/
|
|
107
|
-
observerMode?: boolean;
|
|
108
|
-
/**
|
|
109
|
-
* An optional string. iOS-only, will be ignored for Android.
|
|
110
|
-
* Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults
|
|
111
|
-
* suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults.
|
|
112
|
-
*/
|
|
113
|
-
userDefaultsSuiteName?: string;
|
|
114
|
-
/**
|
|
115
|
-
* iOS-only, will be ignored for Android.
|
|
116
|
-
* Set this to TRUE to enable StoreKit2.
|
|
117
|
-
* Default is FALSE.
|
|
118
|
-
*
|
|
119
|
-
* @deprecated RevenueCat currently uses StoreKit 1 for purchases, as its stability in production scenarios has
|
|
120
|
-
* proven to be more performant than StoreKit 2.
|
|
121
|
-
* We're collecting more data on the best approach, but StoreKit 1 vs StoreKit 2 is an implementation detail
|
|
122
|
-
* that you shouldn't need to care about.
|
|
123
|
-
* We recommend not using this parameter, letting RevenueCat decide for you which StoreKit implementation to use.
|
|
124
|
-
*/
|
|
125
|
-
usesStoreKit2IfAvailable?: boolean;
|
|
126
|
-
/**
|
|
127
|
-
* An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore.
|
|
128
|
-
*/
|
|
129
|
-
useAmazon?: boolean;
|
|
130
|
-
}
|
|
1
|
+
import { PURCHASES_ERROR_CODE, UninitializedPurchasesError, UnsupportedPlatformError, CustomerInfo, PurchasesEntitlementInfo, PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesStoreProduct, UpgradeInfo, PurchasesPromotionalOffer, PurchasesPackage, IntroEligibility, PurchasesStoreProductDiscount, SubscriptionOption, PRODUCT_CATEGORY, GoogleProductChangeInfo, PURCHASE_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, PurchasesConfiguration, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult } from '@revenuecat/purchases-typescript-internal';
|
|
2
|
+
export { PURCHASE_TYPE, BILLING_FEATURE, REFUND_REQUEST_STATUS, LOG_LEVEL, PurchasesConfiguration, CustomerInfoUpdateListener, ShouldPurchasePromoProductListener, MakePurchaseResult, LogHandler, LogInResult } from '@revenuecat/purchases-typescript-internal';
|
|
131
3
|
export default class Purchases {
|
|
132
4
|
/**
|
|
133
5
|
* Supported SKU types.
|
package/dist/purchases.js
CHANGED
|
@@ -38,8 +38,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = exports.BILLING_FEATURE = exports.PURCHASE_TYPE = void 0;
|
|
40
40
|
var react_native_1 = require("react-native");
|
|
41
|
-
var
|
|
42
|
-
|
|
41
|
+
var purchases_typescript_internal_1 = require("@revenuecat/purchases-typescript-internal");
|
|
42
|
+
// This export is kept to keep backwards compatibility to any possible users using this file directly
|
|
43
|
+
var purchases_typescript_internal_2 = require("@revenuecat/purchases-typescript-internal");
|
|
44
|
+
Object.defineProperty(exports, "PURCHASE_TYPE", { enumerable: true, get: function () { return purchases_typescript_internal_2.PURCHASE_TYPE; } });
|
|
45
|
+
Object.defineProperty(exports, "BILLING_FEATURE", { enumerable: true, get: function () { return purchases_typescript_internal_2.BILLING_FEATURE; } });
|
|
46
|
+
Object.defineProperty(exports, "REFUND_REQUEST_STATUS", { enumerable: true, get: function () { return purchases_typescript_internal_2.REFUND_REQUEST_STATUS; } });
|
|
47
|
+
Object.defineProperty(exports, "LOG_LEVEL", { enumerable: true, get: function () { return purchases_typescript_internal_2.LOG_LEVEL; } });
|
|
43
48
|
var react_native_2 = require("react-native");
|
|
44
49
|
var RNPurchases = react_native_1.NativeModules.RNPurchases;
|
|
45
50
|
var eventEmitter = new react_native_1.NativeEventEmitter(RNPurchases);
|
|
@@ -57,74 +62,9 @@ eventEmitter.addListener("Purchases-ShouldPurchasePromoProduct", function (_a) {
|
|
|
57
62
|
});
|
|
58
63
|
eventEmitter.addListener("Purchases-LogHandlerEvent", function (_a) {
|
|
59
64
|
var logLevel = _a.logLevel, message = _a.message;
|
|
60
|
-
var logLevelEnum = LOG_LEVEL[logLevel];
|
|
65
|
+
var logLevelEnum = purchases_typescript_internal_1.LOG_LEVEL[logLevel];
|
|
61
66
|
customLogHandler(logLevelEnum, message);
|
|
62
67
|
});
|
|
63
|
-
/**
|
|
64
|
-
* @deprecated, use PRODUCT_CATEGORY
|
|
65
|
-
*/
|
|
66
|
-
var PURCHASE_TYPE;
|
|
67
|
-
(function (PURCHASE_TYPE) {
|
|
68
|
-
/**
|
|
69
|
-
* A type of SKU for in-app products.
|
|
70
|
-
*/
|
|
71
|
-
PURCHASE_TYPE["INAPP"] = "inapp";
|
|
72
|
-
/**
|
|
73
|
-
* A type of SKU for subscriptions.
|
|
74
|
-
*/
|
|
75
|
-
PURCHASE_TYPE["SUBS"] = "subs";
|
|
76
|
-
})(PURCHASE_TYPE = exports.PURCHASE_TYPE || (exports.PURCHASE_TYPE = {}));
|
|
77
|
-
/**
|
|
78
|
-
* Enum for billing features.
|
|
79
|
-
* Currently, these are only relevant for Google Play Android users:
|
|
80
|
-
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
81
|
-
*/
|
|
82
|
-
var BILLING_FEATURE;
|
|
83
|
-
(function (BILLING_FEATURE) {
|
|
84
|
-
/**
|
|
85
|
-
* Purchase/query for subscriptions.
|
|
86
|
-
*/
|
|
87
|
-
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS"] = 0] = "SUBSCRIPTIONS";
|
|
88
|
-
/**
|
|
89
|
-
* Subscriptions update/replace.
|
|
90
|
-
*/
|
|
91
|
-
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_UPDATE"] = 1] = "SUBSCRIPTIONS_UPDATE";
|
|
92
|
-
/**
|
|
93
|
-
* Purchase/query for in-app items on VR.
|
|
94
|
-
*/
|
|
95
|
-
BILLING_FEATURE[BILLING_FEATURE["IN_APP_ITEMS_ON_VR"] = 2] = "IN_APP_ITEMS_ON_VR";
|
|
96
|
-
/**
|
|
97
|
-
* Purchase/query for subscriptions on VR.
|
|
98
|
-
*/
|
|
99
|
-
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_ON_VR"] = 3] = "SUBSCRIPTIONS_ON_VR";
|
|
100
|
-
/**
|
|
101
|
-
* Launch a price change confirmation flow.
|
|
102
|
-
*/
|
|
103
|
-
BILLING_FEATURE[BILLING_FEATURE["PRICE_CHANGE_CONFIRMATION"] = 4] = "PRICE_CHANGE_CONFIRMATION";
|
|
104
|
-
})(BILLING_FEATURE = exports.BILLING_FEATURE || (exports.BILLING_FEATURE = {}));
|
|
105
|
-
var REFUND_REQUEST_STATUS;
|
|
106
|
-
(function (REFUND_REQUEST_STATUS) {
|
|
107
|
-
/**
|
|
108
|
-
* Apple has received the refund request.
|
|
109
|
-
*/
|
|
110
|
-
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["SUCCESS"] = 0] = "SUCCESS";
|
|
111
|
-
/**
|
|
112
|
-
* User canceled submission of the refund request.
|
|
113
|
-
*/
|
|
114
|
-
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["USER_CANCELLED"] = 1] = "USER_CANCELLED";
|
|
115
|
-
/**
|
|
116
|
-
* There was an error with the request. See message for more details.
|
|
117
|
-
*/
|
|
118
|
-
REFUND_REQUEST_STATUS[REFUND_REQUEST_STATUS["ERROR"] = 2] = "ERROR";
|
|
119
|
-
})(REFUND_REQUEST_STATUS = exports.REFUND_REQUEST_STATUS || (exports.REFUND_REQUEST_STATUS = {}));
|
|
120
|
-
var LOG_LEVEL;
|
|
121
|
-
(function (LOG_LEVEL) {
|
|
122
|
-
LOG_LEVEL["VERBOSE"] = "VERBOSE";
|
|
123
|
-
LOG_LEVEL["DEBUG"] = "DEBUG";
|
|
124
|
-
LOG_LEVEL["INFO"] = "INFO";
|
|
125
|
-
LOG_LEVEL["WARN"] = "WARN";
|
|
126
|
-
LOG_LEVEL["ERROR"] = "ERROR";
|
|
127
|
-
})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {}));
|
|
128
68
|
var Purchases = /** @class */ (function () {
|
|
129
69
|
function Purchases() {
|
|
130
70
|
}
|
|
@@ -282,7 +222,7 @@ var Purchases = /** @class */ (function () {
|
|
|
282
222
|
* if configure has not been called yet.
|
|
283
223
|
*/
|
|
284
224
|
Purchases.getProducts = function (productIdentifiers, type) {
|
|
285
|
-
if (type === void 0) { type =
|
|
225
|
+
if (type === void 0) { type = purchases_typescript_internal_1.PRODUCT_CATEGORY.SUBSCRIPTION; }
|
|
286
226
|
return __awaiter(this, void 0, void 0, function () {
|
|
287
227
|
return __generator(this, function (_a) {
|
|
288
228
|
switch (_a.label) {
|
|
@@ -304,7 +244,7 @@ var Purchases = /** @class */ (function () {
|
|
|
304
244
|
* @deprecated, use purchaseStoreProduct instead
|
|
305
245
|
*/
|
|
306
246
|
Purchases.purchaseProduct = function (productIdentifier, upgradeInfo, type) {
|
|
307
|
-
if (type === void 0) { type = PURCHASE_TYPE.SUBS; }
|
|
247
|
+
if (type === void 0) { type = purchases_typescript_internal_1.PURCHASE_TYPE.SUBS; }
|
|
308
248
|
return __awaiter(this, void 0, void 0, function () {
|
|
309
249
|
return __generator(this, function (_a) {
|
|
310
250
|
switch (_a.label) {
|
|
@@ -312,7 +252,7 @@ var Purchases = /** @class */ (function () {
|
|
|
312
252
|
case 1:
|
|
313
253
|
_a.sent();
|
|
314
254
|
return [2 /*return*/, RNPurchases.purchaseProduct(productIdentifier, upgradeInfo, type, null, null, null).catch(function (error) {
|
|
315
|
-
error.userCancelled = error.code ===
|
|
255
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
316
256
|
throw error;
|
|
317
257
|
})];
|
|
318
258
|
}
|
|
@@ -341,7 +281,7 @@ var Purchases = /** @class */ (function () {
|
|
|
341
281
|
case 1:
|
|
342
282
|
_a.sent();
|
|
343
283
|
return [2 /*return*/, RNPurchases.purchaseProduct(product.identifier, googleProductChangeInfo, product.productCategory, null, googleIsPersonalizedPrice == null ? null : { isPersonalizedPrice: googleIsPersonalizedPrice }, product.presentedOfferingIdentifier).catch(function (error) {
|
|
344
|
-
error.userCancelled = error.code ===
|
|
284
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
345
285
|
throw error;
|
|
346
286
|
})];
|
|
347
287
|
}
|
|
@@ -372,7 +312,7 @@ var Purchases = /** @class */ (function () {
|
|
|
372
312
|
throw new Error("A discount is required");
|
|
373
313
|
}
|
|
374
314
|
return [2 /*return*/, RNPurchases.purchaseProduct(product.identifier, null, null, discount.timestamp.toString(), null, product.presentedOfferingIdentifier).catch(function (error) {
|
|
375
|
-
error.userCancelled = error.code ===
|
|
315
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
376
316
|
throw error;
|
|
377
317
|
})];
|
|
378
318
|
}
|
|
@@ -402,7 +342,7 @@ var Purchases = /** @class */ (function () {
|
|
|
402
342
|
case 1:
|
|
403
343
|
_a.sent();
|
|
404
344
|
return [2 /*return*/, RNPurchases.purchasePackage(aPackage.identifier, aPackage.offeringIdentifier, googleProductChangeInfo || upgradeInfo, null, googleIsPersonalizedPrice == null ? null : { isPersonalizedPrice: googleIsPersonalizedPrice }).catch(function (error) {
|
|
405
|
-
error.userCancelled = error.code ===
|
|
345
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
406
346
|
throw error;
|
|
407
347
|
})];
|
|
408
348
|
}
|
|
@@ -434,7 +374,7 @@ var Purchases = /** @class */ (function () {
|
|
|
434
374
|
case 2:
|
|
435
375
|
_a.sent();
|
|
436
376
|
return [2 /*return*/, RNPurchases.purchaseSubscriptionOption(subscriptionOption.productId, subscriptionOption.id, googleProductChangeInfo, null, googleIsPersonalizedPrice == null ? null : { isPersonalizedPrice: googleIsPersonalizedPrice }, subscriptionOption.presentedOfferingIdentifier).catch(function (error) {
|
|
437
|
-
error.userCancelled = error.code ===
|
|
377
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
438
378
|
throw error;
|
|
439
379
|
})];
|
|
440
380
|
}
|
|
@@ -462,7 +402,7 @@ var Purchases = /** @class */ (function () {
|
|
|
462
402
|
throw new Error("A discount is required");
|
|
463
403
|
}
|
|
464
404
|
return [2 /*return*/, RNPurchases.purchasePackage(aPackage.identifier, aPackage.offeringIdentifier, null, discount.timestamp.toString(), null).catch(function (error) {
|
|
465
|
-
error.userCancelled = error.code ===
|
|
405
|
+
error.userCancelled = error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
466
406
|
throw error;
|
|
467
407
|
})];
|
|
468
408
|
}
|
|
@@ -1300,7 +1240,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1300
1240
|
case 3:
|
|
1301
1241
|
refundRequestStatusInt = _a.sent();
|
|
1302
1242
|
if (refundRequestStatusInt == null) {
|
|
1303
|
-
throw new
|
|
1243
|
+
throw new purchases_typescript_internal_1.UnsupportedPlatformError();
|
|
1304
1244
|
}
|
|
1305
1245
|
return [2 /*return*/, Purchases.convertIntToRefundRequestStatus(refundRequestStatusInt)];
|
|
1306
1246
|
}
|
|
@@ -1333,7 +1273,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1333
1273
|
case 3:
|
|
1334
1274
|
refundRequestStatusInt = _a.sent();
|
|
1335
1275
|
if (refundRequestStatusInt == null) {
|
|
1336
|
-
throw new
|
|
1276
|
+
throw new purchases_typescript_internal_1.UnsupportedPlatformError();
|
|
1337
1277
|
}
|
|
1338
1278
|
return [2 /*return*/, Purchases.convertIntToRefundRequestStatus(refundRequestStatusInt)];
|
|
1339
1279
|
}
|
|
@@ -1366,7 +1306,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1366
1306
|
case 3:
|
|
1367
1307
|
refundRequestStatusInt = _a.sent();
|
|
1368
1308
|
if (refundRequestStatusInt == null) {
|
|
1369
|
-
throw new
|
|
1309
|
+
throw new purchases_typescript_internal_1.UnsupportedPlatformError();
|
|
1370
1310
|
}
|
|
1371
1311
|
return [2 /*return*/, Purchases.convertIntToRefundRequestStatus(refundRequestStatusInt)];
|
|
1372
1312
|
}
|
|
@@ -1390,7 +1330,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1390
1330
|
case 1:
|
|
1391
1331
|
isConfigured = _a.sent();
|
|
1392
1332
|
if (!isConfigured) {
|
|
1393
|
-
throw new
|
|
1333
|
+
throw new purchases_typescript_internal_1.UninitializedPurchasesError();
|
|
1394
1334
|
}
|
|
1395
1335
|
return [2 /*return*/];
|
|
1396
1336
|
}
|
|
@@ -1401,7 +1341,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1401
1341
|
return __awaiter(this, void 0, void 0, function () {
|
|
1402
1342
|
return __generator(this, function (_a) {
|
|
1403
1343
|
if (react_native_2.Platform.OS === "android") {
|
|
1404
|
-
throw new
|
|
1344
|
+
throw new purchases_typescript_internal_1.UnsupportedPlatformError();
|
|
1405
1345
|
}
|
|
1406
1346
|
return [2 /*return*/];
|
|
1407
1347
|
});
|
|
@@ -1411,7 +1351,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1411
1351
|
return __awaiter(this, void 0, void 0, function () {
|
|
1412
1352
|
return __generator(this, function (_a) {
|
|
1413
1353
|
if (react_native_2.Platform.OS === "ios") {
|
|
1414
|
-
throw new
|
|
1354
|
+
throw new purchases_typescript_internal_1.UnsupportedPlatformError();
|
|
1415
1355
|
}
|
|
1416
1356
|
return [2 /*return*/];
|
|
1417
1357
|
});
|
|
@@ -1420,11 +1360,11 @@ var Purchases = /** @class */ (function () {
|
|
|
1420
1360
|
Purchases.convertIntToRefundRequestStatus = function (refundRequestStatusInt) {
|
|
1421
1361
|
switch (refundRequestStatusInt) {
|
|
1422
1362
|
case 0:
|
|
1423
|
-
return REFUND_REQUEST_STATUS.SUCCESS;
|
|
1363
|
+
return purchases_typescript_internal_1.REFUND_REQUEST_STATUS.SUCCESS;
|
|
1424
1364
|
case 1:
|
|
1425
|
-
return REFUND_REQUEST_STATUS.USER_CANCELLED;
|
|
1365
|
+
return purchases_typescript_internal_1.REFUND_REQUEST_STATUS.USER_CANCELLED;
|
|
1426
1366
|
default:
|
|
1427
|
-
return REFUND_REQUEST_STATUS.ERROR;
|
|
1367
|
+
return purchases_typescript_internal_1.REFUND_REQUEST_STATUS.ERROR;
|
|
1428
1368
|
}
|
|
1429
1369
|
};
|
|
1430
1370
|
/**
|
|
@@ -1433,13 +1373,13 @@ var Purchases = /** @class */ (function () {
|
|
|
1433
1373
|
* @enum {string}
|
|
1434
1374
|
* @deprecated, use PRODUCT_CATEGORY
|
|
1435
1375
|
*/
|
|
1436
|
-
Purchases.PURCHASE_TYPE = PURCHASE_TYPE;
|
|
1376
|
+
Purchases.PURCHASE_TYPE = purchases_typescript_internal_1.PURCHASE_TYPE;
|
|
1437
1377
|
/**
|
|
1438
1378
|
* Supported product categories.
|
|
1439
1379
|
* @readonly
|
|
1440
1380
|
* @enum {string}
|
|
1441
1381
|
*/
|
|
1442
|
-
Purchases.PRODUCT_CATEGORY =
|
|
1382
|
+
Purchases.PRODUCT_CATEGORY = purchases_typescript_internal_1.PRODUCT_CATEGORY;
|
|
1443
1383
|
/**
|
|
1444
1384
|
* Enum for billing features.
|
|
1445
1385
|
* Currently, these are only relevant for Google Play Android users:
|
|
@@ -1447,51 +1387,51 @@ var Purchases = /** @class */ (function () {
|
|
|
1447
1387
|
* @readonly
|
|
1448
1388
|
* @enum {string}
|
|
1449
1389
|
*/
|
|
1450
|
-
Purchases.BILLING_FEATURE = BILLING_FEATURE;
|
|
1390
|
+
Purchases.BILLING_FEATURE = purchases_typescript_internal_1.BILLING_FEATURE;
|
|
1451
1391
|
/**
|
|
1452
1392
|
* Enum with possible return states for beginning refund request.
|
|
1453
1393
|
* @readonly
|
|
1454
1394
|
* @enum {string}
|
|
1455
1395
|
*/
|
|
1456
|
-
Purchases.REFUND_REQUEST_STATUS = REFUND_REQUEST_STATUS;
|
|
1396
|
+
Purchases.REFUND_REQUEST_STATUS = purchases_typescript_internal_1.REFUND_REQUEST_STATUS;
|
|
1457
1397
|
/**
|
|
1458
1398
|
* Replace SKU's ProrationMode.
|
|
1459
1399
|
* @readonly
|
|
1460
1400
|
* @enum {number}
|
|
1461
1401
|
*/
|
|
1462
|
-
Purchases.PRORATION_MODE =
|
|
1402
|
+
Purchases.PRORATION_MODE = purchases_typescript_internal_1.PRORATION_MODE;
|
|
1463
1403
|
/**
|
|
1464
1404
|
* Enumeration of all possible Package types.
|
|
1465
1405
|
* @readonly
|
|
1466
1406
|
* @enum {string}
|
|
1467
1407
|
*/
|
|
1468
|
-
Purchases.PACKAGE_TYPE =
|
|
1408
|
+
Purchases.PACKAGE_TYPE = purchases_typescript_internal_1.PACKAGE_TYPE;
|
|
1469
1409
|
/**
|
|
1470
1410
|
* Enum of different possible states for intro price eligibility status.
|
|
1471
1411
|
* @readonly
|
|
1472
1412
|
* @enum {number}
|
|
1473
1413
|
*/
|
|
1474
|
-
Purchases.INTRO_ELIGIBILITY_STATUS =
|
|
1414
|
+
Purchases.INTRO_ELIGIBILITY_STATUS = purchases_typescript_internal_1.INTRO_ELIGIBILITY_STATUS;
|
|
1475
1415
|
/**
|
|
1476
1416
|
* Enum of all error codes the SDK produces.
|
|
1477
1417
|
* @readonly
|
|
1478
1418
|
* @enum {string}
|
|
1479
1419
|
*/
|
|
1480
|
-
Purchases.PURCHASES_ERROR_CODE =
|
|
1420
|
+
Purchases.PURCHASES_ERROR_CODE = purchases_typescript_internal_1.PURCHASES_ERROR_CODE;
|
|
1481
1421
|
/**
|
|
1482
1422
|
* List of valid log levels.
|
|
1483
1423
|
* @readonly
|
|
1484
1424
|
* @enum {string}
|
|
1485
1425
|
*/
|
|
1486
|
-
Purchases.LOG_LEVEL = LOG_LEVEL;
|
|
1426
|
+
Purchases.LOG_LEVEL = purchases_typescript_internal_1.LOG_LEVEL;
|
|
1487
1427
|
/**
|
|
1488
1428
|
* @internal
|
|
1489
1429
|
*/
|
|
1490
|
-
Purchases.UninitializedPurchasesError =
|
|
1430
|
+
Purchases.UninitializedPurchasesError = purchases_typescript_internal_1.UninitializedPurchasesError;
|
|
1491
1431
|
/**
|
|
1492
1432
|
* @internal
|
|
1493
1433
|
*/
|
|
1494
|
-
Purchases.UnsupportedPlatformError =
|
|
1434
|
+
Purchases.UnsupportedPlatformError = purchases_typescript_internal_1.UnsupportedPlatformError;
|
|
1495
1435
|
return Purchases;
|
|
1496
1436
|
}());
|
|
1497
1437
|
exports.default = Purchases;
|
package/ios/RNPurchases.m
CHANGED
|
@@ -390,7 +390,8 @@ RCT_EXPORT_METHOD(setLogHandler) {
|
|
|
390
390
|
#pragma mark -
|
|
391
391
|
#pragma mark Delegate Methods
|
|
392
392
|
- (void)purchases:(RCPurchases *)purchases receivedUpdatedCustomerInfo:(RCCustomerInfo *)customerInfo {
|
|
393
|
-
[self sendEventWithName:RNPurchasesCustomerInfoUpdatedEvent
|
|
393
|
+
[self sendEventWithName:RNPurchasesCustomerInfoUpdatedEvent
|
|
394
|
+
body:[RCCommonFunctionality encodeCustomerInfo:customerInfo]];
|
|
394
395
|
}
|
|
395
396
|
|
|
396
397
|
- (void)purchases:(RCPurchases *)purchases
|
|
@@ -442,7 +443,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
442
443
|
}
|
|
443
444
|
|
|
444
445
|
- (NSString *)platformFlavorVersion {
|
|
445
|
-
return @"6.6.
|
|
446
|
+
return @"6.6.4";
|
|
446
447
|
}
|
|
447
448
|
|
|
448
449
|
@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": "6.6.
|
|
4
|
+
"version": "6.6.4",
|
|
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",
|
|
@@ -93,5 +93,8 @@
|
|
|
93
93
|
"setupFiles": [
|
|
94
94
|
"./scripts/setupJest.js"
|
|
95
95
|
]
|
|
96
|
+
},
|
|
97
|
+
"dependencies": {
|
|
98
|
+
"@revenuecat/purchases-typescript-internal": "6.1.0"
|
|
96
99
|
}
|
|
97
100
|
}
|
package/scripts/docs/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html>
|
|
4
4
|
<head>
|
|
5
|
-
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/6.6.
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/6.6.4/" />
|
|
6
6
|
</head>
|
|
7
7
|
<body>
|
|
8
8
|
</body>
|