react-native-purchases 5.0.0-beta.6 → 5.0.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/README.md +5 -1
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/dist/customerInfo.d.ts +3 -3
- package/dist/purchases.d.ts +43 -43
- package/dist/purchases.js +43 -43
- package/ios/RNPurchases.m +10 -2
- package/package.json +1 -1
- package/scripts/docs/index.html +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ React Native Purchases is a client for the [RevenueCat](https://www.revenuecat.c
|
|
|
16
16
|
➡️ | [Webhooks](https://docs.revenuecat.com/docs/webhooks) - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more
|
|
17
17
|
🎯 | Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web
|
|
18
18
|
📊 | Analytics - automatic calculation of metrics like conversion, mrr, and churn
|
|
19
|
-
📝 | [Online documentation](https://docs.revenuecat.com/docs) up to date
|
|
19
|
+
📝 | [Online documentation](https://docs.revenuecat.com/docs) and [SDK reference](https://revenuecat.github.io/react-native-purchases-docs/) up to date
|
|
20
20
|
🔀 | [Integrations](https://www.revenuecat.com/integrations) - over a dozen integrations to easily send purchase data where you need it
|
|
21
21
|
💯 | Well maintained - [frequent releases](https://github.com/RevenueCat/purchases-ios/releases)
|
|
22
22
|
📮 | Great support - [Help Center](https://revenuecat.zendesk.com)
|
|
@@ -81,3 +81,7 @@ The `react-native link` command should have added the `libRNPurchases.a` library
|
|
|
81
81
|
## Getting Started
|
|
82
82
|
|
|
83
83
|
Please follow the [Quickstart Guide](https://docs.revenuecat.com/docs/) for more information on how to use the SDK
|
|
84
|
+
|
|
85
|
+
## SDK Reference
|
|
86
|
+
Our full SDK reference [can be found here](https://revenuecat.github.io/react-native-purchases-docs).
|
|
87
|
+
|
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 '5.0.
|
|
32
|
+
versionName '5.0.2'
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
buildTypes {
|
|
@@ -121,6 +121,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
|
121
121
|
dependencies {
|
|
122
122
|
//noinspection GradleDynamicVersion
|
|
123
123
|
api 'com.facebook.react:react-native:+'
|
|
124
|
-
implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.1
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.2.1'
|
|
125
125
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
126
126
|
}
|
package/dist/customerInfo.d.ts
CHANGED
|
@@ -144,13 +144,13 @@ export interface CustomerInfo {
|
|
|
144
144
|
*/
|
|
145
145
|
export interface PurchasesStoreTransaction {
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
147
|
+
* Id of the transaction.
|
|
148
148
|
*/
|
|
149
|
-
|
|
149
|
+
transactionIdentifier: string;
|
|
150
150
|
/**
|
|
151
151
|
* Product Id associated with the transaction.
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
productIdentifier: string;
|
|
154
154
|
/**
|
|
155
155
|
* Purchase date of the transaction in ISO 8601 format.
|
|
156
156
|
*/
|
package/dist/purchases.d.ts
CHANGED
|
@@ -134,20 +134,20 @@ export default class Purchases {
|
|
|
134
134
|
* we will treat it as a restore and alias the new ID with the previous id.
|
|
135
135
|
* @param {boolean} allowSharing Set this to true if you are passing in an appUserID but it is anonymous,
|
|
136
136
|
* this is true by default if you didn't pass an appUserID
|
|
137
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
137
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
138
138
|
*/
|
|
139
139
|
static setAllowSharingStoreAccount(allowSharing: boolean): Promise<void>;
|
|
140
140
|
/**
|
|
141
141
|
* @param {boolean} finishTransactions Set finishTransactions to false if you aren't using Purchases SDK to
|
|
142
142
|
* make the purchase
|
|
143
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
143
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
144
144
|
*/
|
|
145
145
|
static setFinishTransactions(finishTransactions: boolean): Promise<void>;
|
|
146
146
|
/**
|
|
147
147
|
* iOS only.
|
|
148
148
|
* @param {boolean} simulatesAskToBuyInSandbox Set this property to true *only* when testing the ask-to-buy / SCA
|
|
149
149
|
* purchases flow. More information: http://errors.rev.cat/ask-to-buy
|
|
150
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
150
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
151
151
|
*/
|
|
152
152
|
static setSimulatesAskToBuyInSandbox(simulatesAskToBuyInSandbox: boolean): Promise<void>;
|
|
153
153
|
/**
|
|
@@ -180,7 +180,7 @@ export default class Purchases {
|
|
|
180
180
|
static removeShouldPurchasePromoProductListener(listenerToRemove: ShouldPurchasePromoProductListener): boolean;
|
|
181
181
|
/**
|
|
182
182
|
* Gets the map of entitlements -> offerings -> products
|
|
183
|
-
* @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if
|
|
183
|
+
* @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure
|
|
184
184
|
* has not been called yet.
|
|
185
185
|
*/
|
|
186
186
|
static getOfferings(): Promise<PurchasesOfferings>;
|
|
@@ -191,7 +191,7 @@ export default class Purchases {
|
|
|
191
191
|
* @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected
|
|
192
192
|
* if the products are not properly configured in RevenueCat or if there is another error retrieving them.
|
|
193
193
|
* Rejections return an error code, and a userInfo object with more information. The promise will also be rejected
|
|
194
|
-
* if
|
|
194
|
+
* if configure has not been called yet.
|
|
195
195
|
*/
|
|
196
196
|
static getProducts(productIdentifiers: string[], type?: PURCHASE_TYPE): Promise<PurchasesStoreProduct[]>;
|
|
197
197
|
/**
|
|
@@ -204,7 +204,7 @@ export default class Purchases {
|
|
|
204
204
|
* @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
|
|
205
205
|
* a customer info object and a product identifier. Rejections return an error code,
|
|
206
206
|
* a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will
|
|
207
|
-
* also be rejected if
|
|
207
|
+
* also be rejected if configure has not been called yet.
|
|
208
208
|
*/
|
|
209
209
|
static purchaseProduct(productIdentifier: string, upgradeInfo?: UpgradeInfo | null, type?: PURCHASE_TYPE): Promise<MakePurchaseResult>;
|
|
210
210
|
/**
|
|
@@ -215,7 +215,7 @@ export default class Purchases {
|
|
|
215
215
|
* @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
|
|
216
216
|
* a customer info object and a product identifier. Rejections return an error code,
|
|
217
217
|
* a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be
|
|
218
|
-
* rejected if
|
|
218
|
+
* rejected if configure has not been called yet.
|
|
219
219
|
*/
|
|
220
220
|
static purchaseDiscountedProduct(product: PurchasesStoreProduct, discount: PurchasesPromotionalOffer): Promise<MakePurchaseResult>;
|
|
221
221
|
/**
|
|
@@ -226,7 +226,7 @@ export default class Purchases {
|
|
|
226
226
|
* and the optional prorationMode.
|
|
227
227
|
* @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
|
|
228
228
|
* a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
|
|
229
|
-
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if
|
|
229
|
+
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
|
|
230
230
|
* has not been called yet.
|
|
231
231
|
*/
|
|
232
232
|
static purchasePackage(aPackage: PurchasesPackage, upgradeInfo?: UpgradeInfo | null): Promise<MakePurchaseResult>;
|
|
@@ -237,14 +237,14 @@ export default class Purchases {
|
|
|
237
237
|
* @param {PurchasesPromotionalOffer} discount Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
|
|
238
238
|
* @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
|
|
239
239
|
* a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
|
|
240
|
-
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if
|
|
240
|
+
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
|
|
241
241
|
* has not been called yet.
|
|
242
242
|
*/
|
|
243
243
|
static purchaseDiscountedPackage(aPackage: PurchasesPackage, discount: PurchasesPromotionalOffer): Promise<MakePurchaseResult>;
|
|
244
244
|
/**
|
|
245
245
|
* Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
|
|
246
246
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
|
|
247
|
-
* userInfo object with more information. The promise will be also be rejected if
|
|
247
|
+
* userInfo object with more information. The promise will be also be rejected if configure has not been called yet.
|
|
248
248
|
*/
|
|
249
249
|
static restorePurchases(): Promise<CustomerInfo>;
|
|
250
250
|
/**
|
|
@@ -258,13 +258,13 @@ export default class Purchases {
|
|
|
258
258
|
* @param {String} appUserID The appUserID that should be linked to the currently user
|
|
259
259
|
* @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well
|
|
260
260
|
* as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The
|
|
261
|
-
* promise will be rejected if
|
|
261
|
+
* promise will be rejected if configure has not been called yet or if there's an issue logging in.
|
|
262
262
|
*/
|
|
263
263
|
static logIn(appUserID: string): Promise<LogInResult>;
|
|
264
264
|
/**
|
|
265
265
|
* Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
266
266
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code,
|
|
267
|
-
* and a userInfo object with more information. The promise will be rejected if
|
|
267
|
+
* and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if
|
|
268
268
|
* there's an issue logging out.
|
|
269
269
|
*/
|
|
270
270
|
static logOut(): Promise<CustomerInfo>;
|
|
@@ -276,7 +276,7 @@ export default class Purchases {
|
|
|
276
276
|
/**
|
|
277
277
|
* Gets current customer info
|
|
278
278
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
|
|
279
|
-
* userInfo object with more information. The promise will be rejected if
|
|
279
|
+
* userInfo object with more information. The promise will be rejected if configure has not been called yet or if
|
|
280
280
|
* there's an issue getting the customer information.
|
|
281
281
|
*/
|
|
282
282
|
static getCustomerInfo(): Promise<CustomerInfo>;
|
|
@@ -285,7 +285,7 @@ export default class Purchases {
|
|
|
285
285
|
* for subscriptions anytime a sync is needed, like after a successful purchase.
|
|
286
286
|
*
|
|
287
287
|
* @warning This function should only be called if you're not calling purchaseProduct/purchasePackage.
|
|
288
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
288
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
289
289
|
* syncing purchases.
|
|
290
290
|
*/
|
|
291
291
|
static syncPurchases(): Promise<void>;
|
|
@@ -293,17 +293,17 @@ export default class Purchases {
|
|
|
293
293
|
* @deprecated, use enableAdServicesAttributionTokenCollection instead.
|
|
294
294
|
* Enable automatic collection of Apple Search Ad attribution. Disabled by default
|
|
295
295
|
* @param {boolean} enabled Enable or not automatic apple search ads attribution collection
|
|
296
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
296
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
297
297
|
*/
|
|
298
298
|
static setAutomaticAppleSearchAdsAttributionCollection(enabled: boolean): Promise<void>;
|
|
299
299
|
/**
|
|
300
300
|
* Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default
|
|
301
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
301
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
302
302
|
*/
|
|
303
303
|
static enableAdServicesAttributionTokenCollection(): Promise<void>;
|
|
304
304
|
/**
|
|
305
305
|
* @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.
|
|
306
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
306
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
307
307
|
*/
|
|
308
308
|
static isAnonymous(): Promise<boolean>;
|
|
309
309
|
/**
|
|
@@ -319,7 +319,7 @@ export default class Purchases {
|
|
|
319
319
|
*
|
|
320
320
|
* @param productIdentifiers Array of product identifiers for which you want to compute eligibility
|
|
321
321
|
* @returns { Promise<[productId: string]: IntroEligibility> } A map of IntroEligility per productId. The promise
|
|
322
|
-
* will be rejected if
|
|
322
|
+
* will be rejected if configure has not been called yet or if there's in an error checking eligibility.
|
|
323
323
|
*/
|
|
324
324
|
static checkTrialOrIntroductoryPriceEligibility(productIdentifiers: string[]): Promise<{
|
|
325
325
|
[productId: string]: IntroEligibility;
|
|
@@ -327,10 +327,10 @@ export default class Purchases {
|
|
|
327
327
|
/**
|
|
328
328
|
* iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.
|
|
329
329
|
*
|
|
330
|
-
* @param product The `
|
|
331
|
-
* @param discount The `
|
|
330
|
+
* @param product The `PurchasesStoreProduct` the user intends to purchase.
|
|
331
|
+
* @param discount The `PurchasesStoreProductDiscount` to apply to the product.
|
|
332
332
|
* @returns { Promise<PurchasesPromotionalOffer> } Returns when the `PurchasesPaymentDiscount` is returned.
|
|
333
|
-
* Null is returned for Android and incompatible iOS versions. The promise will be rejected if
|
|
333
|
+
* Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been
|
|
334
334
|
* called yet or if there's an error getting the payment discount.
|
|
335
335
|
*/
|
|
336
336
|
static getPromotionalOffer(product: PurchasesStoreProduct, discount: PurchasesStoreProductDiscount): Promise<PurchasesPromotionalOffer | undefined>;
|
|
@@ -343,14 +343,14 @@ export default class Purchases {
|
|
|
343
343
|
*
|
|
344
344
|
* This is useful for cases where customer information might have been updated outside of the app, like if a
|
|
345
345
|
* promotional subscription is granted through the RevenueCat dashboard.
|
|
346
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
346
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
347
347
|
* invalidating the customer info cache.
|
|
348
348
|
*/
|
|
349
349
|
static invalidateCustomerInfoCache(): Promise<void>;
|
|
350
350
|
/** iOS only. Presents a code redemption sheet, useful for redeeming offer codes
|
|
351
351
|
* Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
|
|
352
352
|
* to configure and use offer codes
|
|
353
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
353
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
354
354
|
* presenting the code redemption sheet.
|
|
355
355
|
*/
|
|
356
356
|
static presentCodeRedemptionSheet(): Promise<void>;
|
|
@@ -363,7 +363,7 @@ export default class Purchases {
|
|
|
363
363
|
* restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
|
|
364
364
|
*
|
|
365
365
|
* @param attributes Map of attributes by key. Set the value as an empty string to delete an attribute.
|
|
366
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
366
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
367
367
|
* setting the subscriber attributes.
|
|
368
368
|
*/
|
|
369
369
|
static setAttributes(attributes: {
|
|
@@ -373,7 +373,7 @@ export default class Purchases {
|
|
|
373
373
|
* Subscriber attribute associated with the email address for the user
|
|
374
374
|
*
|
|
375
375
|
* @param email Empty String or null will delete the subscriber attribute.
|
|
376
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
376
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
377
377
|
* setting the email.
|
|
378
378
|
*/
|
|
379
379
|
static setEmail(email: string | null): Promise<void>;
|
|
@@ -381,7 +381,7 @@ export default class Purchases {
|
|
|
381
381
|
* Subscriber attribute associated with the phone number for the user
|
|
382
382
|
*
|
|
383
383
|
* @param phoneNumber Empty String or null will delete the subscriber attribute.
|
|
384
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
384
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
385
385
|
* setting the phone number.
|
|
386
386
|
*/
|
|
387
387
|
static setPhoneNumber(phoneNumber: string | null): Promise<void>;
|
|
@@ -389,7 +389,7 @@ export default class Purchases {
|
|
|
389
389
|
* Subscriber attribute associated with the display name for the user
|
|
390
390
|
*
|
|
391
391
|
* @param displayName Empty String or null will delete the subscriber attribute.
|
|
392
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
392
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
393
393
|
* setting the display name.
|
|
394
394
|
*/
|
|
395
395
|
static setDisplayName(displayName: string | null): Promise<void>;
|
|
@@ -397,14 +397,14 @@ export default class Purchases {
|
|
|
397
397
|
* Subscriber attribute associated with the push token for the user
|
|
398
398
|
*
|
|
399
399
|
* @param pushToken null will delete the subscriber attribute.
|
|
400
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
400
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
401
401
|
* setting the push token.
|
|
402
402
|
*/
|
|
403
403
|
static setPushToken(pushToken: string | null): Promise<void>;
|
|
404
404
|
/**
|
|
405
405
|
* Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value
|
|
406
406
|
* from your RevenueCat contact.
|
|
407
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
407
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
408
408
|
* setting the proxy url.
|
|
409
409
|
*/
|
|
410
410
|
static setProxyURL(url: string): Promise<void>;
|
|
@@ -412,7 +412,7 @@ export default class Purchases {
|
|
|
412
412
|
* Automatically collect subscriber attributes associated with the device identifiers.
|
|
413
413
|
* $idfa, $idfv, $ip on iOS
|
|
414
414
|
* $gpsAdId, $androidId, $ip on Android
|
|
415
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
415
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
416
416
|
* setting collecting the device identifiers.
|
|
417
417
|
*/
|
|
418
418
|
static collectDeviceIdentifiers(): Promise<void>;
|
|
@@ -421,7 +421,7 @@ export default class Purchases {
|
|
|
421
421
|
* Required for the RevenueCat Adjust integration
|
|
422
422
|
*
|
|
423
423
|
* @param adjustID Empty String or null will delete the subscriber attribute.
|
|
424
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
424
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
425
425
|
* setting Adjust ID.
|
|
426
426
|
*/
|
|
427
427
|
static setAdjustID(adjustID: string | null): Promise<void>;
|
|
@@ -429,7 +429,7 @@ export default class Purchases {
|
|
|
429
429
|
* Subscriber attribute associated with the AppsFlyer Id for the user
|
|
430
430
|
* Required for the RevenueCat AppsFlyer integration
|
|
431
431
|
* @param appsflyerID Empty String or null will delete the subscriber attribute.
|
|
432
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
432
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
433
433
|
* setting the Appsflyer ID.
|
|
434
434
|
*/
|
|
435
435
|
static setAppsflyerID(appsflyerID: string | null): Promise<void>;
|
|
@@ -438,7 +438,7 @@ export default class Purchases {
|
|
|
438
438
|
* Recommended for the RevenueCat Facebook integration
|
|
439
439
|
*
|
|
440
440
|
* @param fbAnonymousID Empty String or null will delete the subscriber attribute.
|
|
441
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
441
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
442
442
|
* setting the Facebook Anonymous ID.
|
|
443
443
|
*/
|
|
444
444
|
static setFBAnonymousID(fbAnonymousID: string | null): Promise<void>;
|
|
@@ -447,7 +447,7 @@ export default class Purchases {
|
|
|
447
447
|
* Recommended for the RevenueCat mParticle integration
|
|
448
448
|
*
|
|
449
449
|
* @param mparticleID Empty String or null will delete the subscriber attribute.
|
|
450
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
450
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
451
451
|
* setting the Mparticle ID.
|
|
452
452
|
*/
|
|
453
453
|
static setMparticleID(mparticleID: string | null): Promise<void>;
|
|
@@ -456,7 +456,7 @@ export default class Purchases {
|
|
|
456
456
|
* Required for the RevenueCat OneSignal integration
|
|
457
457
|
*
|
|
458
458
|
* @param onesignalID Empty String or null will delete the subscriber attribute.
|
|
459
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
459
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
460
460
|
* setting the Onesignal ID.
|
|
461
461
|
*/
|
|
462
462
|
static setOnesignalID(onesignalID: string | null): Promise<void>;
|
|
@@ -465,7 +465,7 @@ export default class Purchases {
|
|
|
465
465
|
* Required for the RevenueCat Airship integration
|
|
466
466
|
*
|
|
467
467
|
* @param airshipChannelID Empty String or null will delete the subscriber attribute.
|
|
468
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
468
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
469
469
|
* setting the Airship Channel ID.
|
|
470
470
|
*/
|
|
471
471
|
static setAirshipChannelID(airshipChannelID: string | null): Promise<void>;
|
|
@@ -473,7 +473,7 @@ export default class Purchases {
|
|
|
473
473
|
* Subscriber attribute associated with the install media source for the user
|
|
474
474
|
*
|
|
475
475
|
* @param mediaSource Empty String or null will delete the subscriber attribute.
|
|
476
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
476
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
477
477
|
* setting the media source.
|
|
478
478
|
*/
|
|
479
479
|
static setMediaSource(mediaSource: string | null): Promise<void>;
|
|
@@ -481,7 +481,7 @@ export default class Purchases {
|
|
|
481
481
|
* Subscriber attribute associated with the install campaign for the user
|
|
482
482
|
*
|
|
483
483
|
* @param campaign Empty String or null will delete the subscriber attribute.
|
|
484
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
484
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
485
485
|
* setting the campaign.
|
|
486
486
|
*/
|
|
487
487
|
static setCampaign(campaign: string | null): Promise<void>;
|
|
@@ -489,7 +489,7 @@ export default class Purchases {
|
|
|
489
489
|
* Subscriber attribute associated with the install ad group for the user
|
|
490
490
|
*
|
|
491
491
|
* @param adGroup Empty String or null will delete the subscriber attribute.
|
|
492
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
492
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
493
493
|
* setting ad group.
|
|
494
494
|
*/
|
|
495
495
|
static setAdGroup(adGroup: string | null): Promise<void>;
|
|
@@ -497,7 +497,7 @@ export default class Purchases {
|
|
|
497
497
|
* Subscriber attribute associated with the install ad for the user
|
|
498
498
|
*
|
|
499
499
|
* @param ad Empty String or null will delete the subscriber attribute.
|
|
500
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
500
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
501
501
|
* setting the ad subscriber attribute.
|
|
502
502
|
*/
|
|
503
503
|
static setAd(ad: string | null): Promise<void>;
|
|
@@ -505,7 +505,7 @@ export default class Purchases {
|
|
|
505
505
|
* Subscriber attribute associated with the install keyword for the user
|
|
506
506
|
*
|
|
507
507
|
* @param keyword Empty String or null will delete the subscriber attribute.
|
|
508
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
508
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
509
509
|
* setting the keyword.
|
|
510
510
|
*/
|
|
511
511
|
static setKeyword(keyword: string | null): Promise<void>;
|
|
@@ -513,7 +513,7 @@ export default class Purchases {
|
|
|
513
513
|
* Subscriber attribute associated with the install ad creative for the user
|
|
514
514
|
*
|
|
515
515
|
* @param creative Empty String or null will delete the subscriber attribute.
|
|
516
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
516
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
517
517
|
* setting the creative subscriber attribute.
|
|
518
518
|
*/
|
|
519
519
|
static setCreative(creative: string | null): Promise<void>;
|
|
@@ -530,7 +530,7 @@ export default class Purchases {
|
|
|
530
530
|
*/
|
|
531
531
|
static canMakePayments(features?: BILLING_FEATURE[]): Promise<boolean>;
|
|
532
532
|
/**
|
|
533
|
-
* Check if
|
|
533
|
+
* Check if configure has finished and Purchases has been configured.
|
|
534
534
|
*
|
|
535
535
|
* @returns {Promise<Boolean>} promise with boolean response
|
|
536
536
|
*/
|
package/dist/purchases.js
CHANGED
|
@@ -123,7 +123,7 @@ var Purchases = /** @class */ (function () {
|
|
|
123
123
|
* we will treat it as a restore and alias the new ID with the previous id.
|
|
124
124
|
* @param {boolean} allowSharing Set this to true if you are passing in an appUserID but it is anonymous,
|
|
125
125
|
* this is true by default if you didn't pass an appUserID
|
|
126
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
126
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
127
127
|
*/
|
|
128
128
|
Purchases.setAllowSharingStoreAccount = function (allowSharing) {
|
|
129
129
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -141,7 +141,7 @@ var Purchases = /** @class */ (function () {
|
|
|
141
141
|
/**
|
|
142
142
|
* @param {boolean} finishTransactions Set finishTransactions to false if you aren't using Purchases SDK to
|
|
143
143
|
* make the purchase
|
|
144
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
144
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
145
145
|
*/
|
|
146
146
|
Purchases.setFinishTransactions = function (finishTransactions) {
|
|
147
147
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -160,7 +160,7 @@ var Purchases = /** @class */ (function () {
|
|
|
160
160
|
* iOS only.
|
|
161
161
|
* @param {boolean} simulatesAskToBuyInSandbox Set this property to true *only* when testing the ask-to-buy / SCA
|
|
162
162
|
* purchases flow. More information: http://errors.rev.cat/ask-to-buy
|
|
163
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
163
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
164
164
|
*/
|
|
165
165
|
Purchases.setSimulatesAskToBuyInSandbox = function (simulatesAskToBuyInSandbox) {
|
|
166
166
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -224,7 +224,7 @@ var Purchases = /** @class */ (function () {
|
|
|
224
224
|
};
|
|
225
225
|
/**
|
|
226
226
|
* Gets the map of entitlements -> offerings -> products
|
|
227
|
-
* @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if
|
|
227
|
+
* @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure
|
|
228
228
|
* has not been called yet.
|
|
229
229
|
*/
|
|
230
230
|
Purchases.getOfferings = function () {
|
|
@@ -246,7 +246,7 @@ var Purchases = /** @class */ (function () {
|
|
|
246
246
|
* @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected
|
|
247
247
|
* if the products are not properly configured in RevenueCat or if there is another error retrieving them.
|
|
248
248
|
* Rejections return an error code, and a userInfo object with more information. The promise will also be rejected
|
|
249
|
-
* if
|
|
249
|
+
* if configure has not been called yet.
|
|
250
250
|
*/
|
|
251
251
|
Purchases.getProducts = function (productIdentifiers, type) {
|
|
252
252
|
if (type === void 0) { type = PURCHASE_TYPE.SUBS; }
|
|
@@ -271,7 +271,7 @@ var Purchases = /** @class */ (function () {
|
|
|
271
271
|
* @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
|
|
272
272
|
* a customer info object and a product identifier. Rejections return an error code,
|
|
273
273
|
* a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will
|
|
274
|
-
* also be rejected if
|
|
274
|
+
* also be rejected if configure has not been called yet.
|
|
275
275
|
*/
|
|
276
276
|
Purchases.purchaseProduct = function (productIdentifier, upgradeInfo, type) {
|
|
277
277
|
if (type === void 0) { type = PURCHASE_TYPE.SUBS; }
|
|
@@ -297,7 +297,7 @@ var Purchases = /** @class */ (function () {
|
|
|
297
297
|
* @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
|
|
298
298
|
* a customer info object and a product identifier. Rejections return an error code,
|
|
299
299
|
* a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be
|
|
300
|
-
* rejected if
|
|
300
|
+
* rejected if configure has not been called yet.
|
|
301
301
|
*/
|
|
302
302
|
Purchases.purchaseDiscountedProduct = function (product, discount) {
|
|
303
303
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -325,7 +325,7 @@ var Purchases = /** @class */ (function () {
|
|
|
325
325
|
* and the optional prorationMode.
|
|
326
326
|
* @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
|
|
327
327
|
* a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
|
|
328
|
-
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if
|
|
328
|
+
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
|
|
329
329
|
* has not been called yet.
|
|
330
330
|
*/
|
|
331
331
|
Purchases.purchasePackage = function (aPackage, upgradeInfo) {
|
|
@@ -350,7 +350,7 @@ var Purchases = /** @class */ (function () {
|
|
|
350
350
|
* @param {PurchasesPromotionalOffer} discount Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
|
|
351
351
|
* @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
|
|
352
352
|
* a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
|
|
353
|
-
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if
|
|
353
|
+
* user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
|
|
354
354
|
* has not been called yet.
|
|
355
355
|
*/
|
|
356
356
|
Purchases.purchaseDiscountedPackage = function (aPackage, discount) {
|
|
@@ -374,7 +374,7 @@ var Purchases = /** @class */ (function () {
|
|
|
374
374
|
/**
|
|
375
375
|
* Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
|
|
376
376
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
|
|
377
|
-
* userInfo object with more information. The promise will be also be rejected if
|
|
377
|
+
* userInfo object with more information. The promise will be also be rejected if configure has not been called yet.
|
|
378
378
|
*/
|
|
379
379
|
Purchases.restorePurchases = function () {
|
|
380
380
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -410,7 +410,7 @@ var Purchases = /** @class */ (function () {
|
|
|
410
410
|
* @param {String} appUserID The appUserID that should be linked to the currently user
|
|
411
411
|
* @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well
|
|
412
412
|
* as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The
|
|
413
|
-
* promise will be rejected if
|
|
413
|
+
* promise will be rejected if configure has not been called yet or if there's an issue logging in.
|
|
414
414
|
*/
|
|
415
415
|
Purchases.logIn = function (appUserID) {
|
|
416
416
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -431,7 +431,7 @@ var Purchases = /** @class */ (function () {
|
|
|
431
431
|
/**
|
|
432
432
|
* Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
|
|
433
433
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code,
|
|
434
|
-
* and a userInfo object with more information. The promise will be rejected if
|
|
434
|
+
* and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if
|
|
435
435
|
* there's an issue logging out.
|
|
436
436
|
*/
|
|
437
437
|
Purchases.logOut = function () {
|
|
@@ -461,7 +461,7 @@ var Purchases = /** @class */ (function () {
|
|
|
461
461
|
/**
|
|
462
462
|
* Gets current customer info
|
|
463
463
|
* @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
|
|
464
|
-
* userInfo object with more information. The promise will be rejected if
|
|
464
|
+
* userInfo object with more information. The promise will be rejected if configure has not been called yet or if
|
|
465
465
|
* there's an issue getting the customer information.
|
|
466
466
|
*/
|
|
467
467
|
Purchases.getCustomerInfo = function () {
|
|
@@ -481,7 +481,7 @@ var Purchases = /** @class */ (function () {
|
|
|
481
481
|
* for subscriptions anytime a sync is needed, like after a successful purchase.
|
|
482
482
|
*
|
|
483
483
|
* @warning This function should only be called if you're not calling purchaseProduct/purchasePackage.
|
|
484
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
484
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
485
485
|
* syncing purchases.
|
|
486
486
|
*/
|
|
487
487
|
Purchases.syncPurchases = function () {
|
|
@@ -501,7 +501,7 @@ var Purchases = /** @class */ (function () {
|
|
|
501
501
|
* @deprecated, use enableAdServicesAttributionTokenCollection instead.
|
|
502
502
|
* Enable automatic collection of Apple Search Ad attribution. Disabled by default
|
|
503
503
|
* @param {boolean} enabled Enable or not automatic apple search ads attribution collection
|
|
504
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
504
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
505
505
|
*/
|
|
506
506
|
Purchases.setAutomaticAppleSearchAdsAttributionCollection = function (enabled) {
|
|
507
507
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -515,7 +515,7 @@ var Purchases = /** @class */ (function () {
|
|
|
515
515
|
};
|
|
516
516
|
/**
|
|
517
517
|
* Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default
|
|
518
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
518
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
519
519
|
*/
|
|
520
520
|
Purchases.enableAdServicesAttributionTokenCollection = function () {
|
|
521
521
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -535,7 +535,7 @@ var Purchases = /** @class */ (function () {
|
|
|
535
535
|
};
|
|
536
536
|
/**
|
|
537
537
|
* @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.
|
|
538
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
538
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
|
|
539
539
|
*/
|
|
540
540
|
Purchases.isAnonymous = function () {
|
|
541
541
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -562,7 +562,7 @@ var Purchases = /** @class */ (function () {
|
|
|
562
562
|
*
|
|
563
563
|
* @param productIdentifiers Array of product identifiers for which you want to compute eligibility
|
|
564
564
|
* @returns { Promise<[productId: string]: IntroEligibility> } A map of IntroEligility per productId. The promise
|
|
565
|
-
* will be rejected if
|
|
565
|
+
* will be rejected if configure has not been called yet or if there's in an error checking eligibility.
|
|
566
566
|
*/
|
|
567
567
|
Purchases.checkTrialOrIntroductoryPriceEligibility = function (productIdentifiers) {
|
|
568
568
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -579,10 +579,10 @@ var Purchases = /** @class */ (function () {
|
|
|
579
579
|
/**
|
|
580
580
|
* iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.
|
|
581
581
|
*
|
|
582
|
-
* @param product The `
|
|
583
|
-
* @param discount The `
|
|
582
|
+
* @param product The `PurchasesStoreProduct` the user intends to purchase.
|
|
583
|
+
* @param discount The `PurchasesStoreProductDiscount` to apply to the product.
|
|
584
584
|
* @returns { Promise<PurchasesPromotionalOffer> } Returns when the `PurchasesPaymentDiscount` is returned.
|
|
585
|
-
* Null is returned for Android and incompatible iOS versions. The promise will be rejected if
|
|
585
|
+
* Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been
|
|
586
586
|
* called yet or if there's an error getting the payment discount.
|
|
587
587
|
*/
|
|
588
588
|
Purchases.getPromotionalOffer = function (product, discount) {
|
|
@@ -612,7 +612,7 @@ var Purchases = /** @class */ (function () {
|
|
|
612
612
|
*
|
|
613
613
|
* This is useful for cases where customer information might have been updated outside of the app, like if a
|
|
614
614
|
* promotional subscription is granted through the RevenueCat dashboard.
|
|
615
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
615
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
616
616
|
* invalidating the customer info cache.
|
|
617
617
|
*/
|
|
618
618
|
Purchases.invalidateCustomerInfoCache = function () {
|
|
@@ -631,7 +631,7 @@ var Purchases = /** @class */ (function () {
|
|
|
631
631
|
/** iOS only. Presents a code redemption sheet, useful for redeeming offer codes
|
|
632
632
|
* Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
|
|
633
633
|
* to configure and use offer codes
|
|
634
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
634
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
635
635
|
* presenting the code redemption sheet.
|
|
636
636
|
*/
|
|
637
637
|
Purchases.presentCodeRedemptionSheet = function () {
|
|
@@ -659,7 +659,7 @@ var Purchases = /** @class */ (function () {
|
|
|
659
659
|
* restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
|
|
660
660
|
*
|
|
661
661
|
* @param attributes Map of attributes by key. Set the value as an empty string to delete an attribute.
|
|
662
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
662
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
|
|
663
663
|
* setting the subscriber attributes.
|
|
664
664
|
*/
|
|
665
665
|
Purchases.setAttributes = function (attributes) {
|
|
@@ -679,7 +679,7 @@ var Purchases = /** @class */ (function () {
|
|
|
679
679
|
* Subscriber attribute associated with the email address for the user
|
|
680
680
|
*
|
|
681
681
|
* @param email Empty String or null will delete the subscriber attribute.
|
|
682
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
682
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
683
683
|
* setting the email.
|
|
684
684
|
*/
|
|
685
685
|
Purchases.setEmail = function (email) {
|
|
@@ -699,7 +699,7 @@ var Purchases = /** @class */ (function () {
|
|
|
699
699
|
* Subscriber attribute associated with the phone number for the user
|
|
700
700
|
*
|
|
701
701
|
* @param phoneNumber Empty String or null will delete the subscriber attribute.
|
|
702
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
702
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
703
703
|
* setting the phone number.
|
|
704
704
|
*/
|
|
705
705
|
Purchases.setPhoneNumber = function (phoneNumber) {
|
|
@@ -719,7 +719,7 @@ var Purchases = /** @class */ (function () {
|
|
|
719
719
|
* Subscriber attribute associated with the display name for the user
|
|
720
720
|
*
|
|
721
721
|
* @param displayName Empty String or null will delete the subscriber attribute.
|
|
722
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
722
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
723
723
|
* setting the display name.
|
|
724
724
|
*/
|
|
725
725
|
Purchases.setDisplayName = function (displayName) {
|
|
@@ -739,7 +739,7 @@ var Purchases = /** @class */ (function () {
|
|
|
739
739
|
* Subscriber attribute associated with the push token for the user
|
|
740
740
|
*
|
|
741
741
|
* @param pushToken null will delete the subscriber attribute.
|
|
742
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
742
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
743
743
|
* setting the push token.
|
|
744
744
|
*/
|
|
745
745
|
Purchases.setPushToken = function (pushToken) {
|
|
@@ -758,7 +758,7 @@ var Purchases = /** @class */ (function () {
|
|
|
758
758
|
/**
|
|
759
759
|
* Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value
|
|
760
760
|
* from your RevenueCat contact.
|
|
761
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
761
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
762
762
|
* setting the proxy url.
|
|
763
763
|
*/
|
|
764
764
|
Purchases.setProxyURL = function (url) {
|
|
@@ -778,7 +778,7 @@ var Purchases = /** @class */ (function () {
|
|
|
778
778
|
* Automatically collect subscriber attributes associated with the device identifiers.
|
|
779
779
|
* $idfa, $idfv, $ip on iOS
|
|
780
780
|
* $gpsAdId, $androidId, $ip on Android
|
|
781
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
781
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
782
782
|
* setting collecting the device identifiers.
|
|
783
783
|
*/
|
|
784
784
|
Purchases.collectDeviceIdentifiers = function () {
|
|
@@ -799,7 +799,7 @@ var Purchases = /** @class */ (function () {
|
|
|
799
799
|
* Required for the RevenueCat Adjust integration
|
|
800
800
|
*
|
|
801
801
|
* @param adjustID Empty String or null will delete the subscriber attribute.
|
|
802
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
802
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
803
803
|
* setting Adjust ID.
|
|
804
804
|
*/
|
|
805
805
|
Purchases.setAdjustID = function (adjustID) {
|
|
@@ -819,7 +819,7 @@ var Purchases = /** @class */ (function () {
|
|
|
819
819
|
* Subscriber attribute associated with the AppsFlyer Id for the user
|
|
820
820
|
* Required for the RevenueCat AppsFlyer integration
|
|
821
821
|
* @param appsflyerID Empty String or null will delete the subscriber attribute.
|
|
822
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
822
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
823
823
|
* setting the Appsflyer ID.
|
|
824
824
|
*/
|
|
825
825
|
Purchases.setAppsflyerID = function (appsflyerID) {
|
|
@@ -840,7 +840,7 @@ var Purchases = /** @class */ (function () {
|
|
|
840
840
|
* Recommended for the RevenueCat Facebook integration
|
|
841
841
|
*
|
|
842
842
|
* @param fbAnonymousID Empty String or null will delete the subscriber attribute.
|
|
843
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
843
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
844
844
|
* setting the Facebook Anonymous ID.
|
|
845
845
|
*/
|
|
846
846
|
Purchases.setFBAnonymousID = function (fbAnonymousID) {
|
|
@@ -861,7 +861,7 @@ var Purchases = /** @class */ (function () {
|
|
|
861
861
|
* Recommended for the RevenueCat mParticle integration
|
|
862
862
|
*
|
|
863
863
|
* @param mparticleID Empty String or null will delete the subscriber attribute.
|
|
864
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
864
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
865
865
|
* setting the Mparticle ID.
|
|
866
866
|
*/
|
|
867
867
|
Purchases.setMparticleID = function (mparticleID) {
|
|
@@ -882,7 +882,7 @@ var Purchases = /** @class */ (function () {
|
|
|
882
882
|
* Required for the RevenueCat OneSignal integration
|
|
883
883
|
*
|
|
884
884
|
* @param onesignalID Empty String or null will delete the subscriber attribute.
|
|
885
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
885
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
886
886
|
* setting the Onesignal ID.
|
|
887
887
|
*/
|
|
888
888
|
Purchases.setOnesignalID = function (onesignalID) {
|
|
@@ -903,7 +903,7 @@ var Purchases = /** @class */ (function () {
|
|
|
903
903
|
* Required for the RevenueCat Airship integration
|
|
904
904
|
*
|
|
905
905
|
* @param airshipChannelID Empty String or null will delete the subscriber attribute.
|
|
906
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
906
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
907
907
|
* setting the Airship Channel ID.
|
|
908
908
|
*/
|
|
909
909
|
Purchases.setAirshipChannelID = function (airshipChannelID) {
|
|
@@ -923,7 +923,7 @@ var Purchases = /** @class */ (function () {
|
|
|
923
923
|
* Subscriber attribute associated with the install media source for the user
|
|
924
924
|
*
|
|
925
925
|
* @param mediaSource Empty String or null will delete the subscriber attribute.
|
|
926
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
926
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
927
927
|
* setting the media source.
|
|
928
928
|
*/
|
|
929
929
|
Purchases.setMediaSource = function (mediaSource) {
|
|
@@ -943,7 +943,7 @@ var Purchases = /** @class */ (function () {
|
|
|
943
943
|
* Subscriber attribute associated with the install campaign for the user
|
|
944
944
|
*
|
|
945
945
|
* @param campaign Empty String or null will delete the subscriber attribute.
|
|
946
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
946
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
947
947
|
* setting the campaign.
|
|
948
948
|
*/
|
|
949
949
|
Purchases.setCampaign = function (campaign) {
|
|
@@ -963,7 +963,7 @@ var Purchases = /** @class */ (function () {
|
|
|
963
963
|
* Subscriber attribute associated with the install ad group for the user
|
|
964
964
|
*
|
|
965
965
|
* @param adGroup Empty String or null will delete the subscriber attribute.
|
|
966
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
966
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
967
967
|
* setting ad group.
|
|
968
968
|
*/
|
|
969
969
|
Purchases.setAdGroup = function (adGroup) {
|
|
@@ -983,7 +983,7 @@ var Purchases = /** @class */ (function () {
|
|
|
983
983
|
* Subscriber attribute associated with the install ad for the user
|
|
984
984
|
*
|
|
985
985
|
* @param ad Empty String or null will delete the subscriber attribute.
|
|
986
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
986
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
987
987
|
* setting the ad subscriber attribute.
|
|
988
988
|
*/
|
|
989
989
|
Purchases.setAd = function (ad) {
|
|
@@ -1003,7 +1003,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1003
1003
|
* Subscriber attribute associated with the install keyword for the user
|
|
1004
1004
|
*
|
|
1005
1005
|
* @param keyword Empty String or null will delete the subscriber attribute.
|
|
1006
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
1006
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
1007
1007
|
* setting the keyword.
|
|
1008
1008
|
*/
|
|
1009
1009
|
Purchases.setKeyword = function (keyword) {
|
|
@@ -1023,7 +1023,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1023
1023
|
* Subscriber attribute associated with the install ad creative for the user
|
|
1024
1024
|
*
|
|
1025
1025
|
* @param creative Empty String or null will delete the subscriber attribute.
|
|
1026
|
-
* @returns {Promise<void>} The promise will be rejected if
|
|
1026
|
+
* @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
|
|
1027
1027
|
* setting the creative subscriber attribute.
|
|
1028
1028
|
*/
|
|
1029
1029
|
Purchases.setCreative = function (creative) {
|
|
@@ -1055,7 +1055,7 @@ var Purchases = /** @class */ (function () {
|
|
|
1055
1055
|
return RNPurchases.canMakePayments(features);
|
|
1056
1056
|
};
|
|
1057
1057
|
/**
|
|
1058
|
-
* Check if
|
|
1058
|
+
* Check if configure has finished and Purchases has been configured.
|
|
1059
1059
|
*
|
|
1060
1060
|
* @returns {Promise<Boolean>} promise with boolean response
|
|
1061
1061
|
*/
|
package/ios/RNPurchases.m
CHANGED
|
@@ -202,11 +202,19 @@ RCT_REMAP_METHOD(getPromotionalOffer,
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
RCT_EXPORT_METHOD(presentCodeRedemptionSheet) {
|
|
205
|
+
#if TARGET_OS_MACCATALYST
|
|
206
|
+
logUnavailablePresentCodeRedemptionSheet();
|
|
207
|
+
#else
|
|
205
208
|
if (@available(iOS 14.0, *)) {
|
|
206
209
|
[RCCommonFunctionality presentCodeRedemptionSheet];
|
|
207
210
|
} else {
|
|
208
|
-
|
|
211
|
+
logUnavailablePresentCodeRedemptionSheet();
|
|
209
212
|
}
|
|
213
|
+
#endif
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
static void logUnavailablePresentCodeRedemptionSheet() {
|
|
217
|
+
NSLog(@"[Purchases] Warning: tried to present codeRedemptionSheet, but it's only available on iOS 14.0 or greater.");
|
|
210
218
|
}
|
|
211
219
|
|
|
212
220
|
#pragma mark - Subscriber Attributes
|
|
@@ -346,7 +354,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
346
354
|
}
|
|
347
355
|
|
|
348
356
|
- (NSString *)platformFlavorVersion {
|
|
349
|
-
return @"5.0.
|
|
357
|
+
return @"5.0.2";
|
|
350
358
|
}
|
|
351
359
|
|
|
352
360
|
@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": "5.0.
|
|
4
|
+
"version": "5.0.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",
|
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/5.0.
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.2/" />
|
|
6
6
|
</head>
|
|
7
7
|
<body>
|
|
8
8
|
</body>
|