react-native-purchases 5.0.0-beta.5 → 5.0.1

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/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 setup has not been called yet.
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 setup has not been called yet.
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 setup has not been called yet.
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 setup
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 setup has not been called yet.
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 setup has not been called yet.
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 setup has not been called yet.
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 setup
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 setup
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 setup has not been called yet.
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 setup has not been called yet or if there's an issue logging in.
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 setup has not been called yet or 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 setup has not been called yet or 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 setup has not been called yet or if there's an error
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 setup has not been called yet.
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 setup has not been called yet.
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 setup has not been called yet.
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 setup has not been called yet or if there's in an error checking eligibility.
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 `PurchasesProduct` the user intends to purchase.
583
- * @param discount The `PurchasesDiscount` to apply to the product.
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 setup has not been
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 setup has not been called yet or there's an error
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 setup has not been called yet or there's an error
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 setup has not been called yet or there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has not been called yet or if there's an error
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 setup has finished and Purchases has been configured.
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
- NSLog(@"[Purchases] Warning: tried to present codeRedemptionSheet, but it's only available on iOS 14.0 or greater.");
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.0-beta.5";
357
+ return @"5.0.1";
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.0-beta.5",
4
+ "version": "5.0.1",
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",
@@ -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.0-beta.5/" />
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.1/" />
6
6
  </head>
7
7
  <body>
8
8
  </body>
@@ -1,126 +0,0 @@
1
- buildscript {
2
- def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['Purchases_kotlinVersion']
3
- repositories {
4
- google()
5
- mavenCentral()
6
- }
7
-
8
- dependencies {
9
- classpath 'com.android.tools.build:gradle:4.0.1'
10
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11
- }
12
- }
13
-
14
- apply plugin: 'com.android.library'
15
- apply plugin: 'kotlin-android'
16
-
17
- def getExtOrDefault(name) {
18
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Purchases_' + name]
19
- }
20
-
21
- def getExtOrIntegerDefault(name) {
22
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['Purchases_' + name]).toInteger()
23
- }
24
-
25
- android {
26
- compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
27
-
28
- defaultConfig {
29
- minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
- targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
- versionCode 1
32
- versionName '5.0.0-beta.5'
33
- }
34
-
35
- buildTypes {
36
- release {
37
- minifyEnabled false
38
- }
39
- }
40
- lintOptions {
41
- disable 'GradleCompatible'
42
- }
43
- compileOptions {
44
- sourceCompatibility JavaVersion.VERSION_1_8
45
- targetCompatibility JavaVersion.VERSION_1_8
46
- }
47
- }
48
-
49
- repositories {
50
- mavenCentral()
51
- google()
52
-
53
- def found = false
54
- def defaultDir = null
55
- def androidSourcesName = 'React Native sources'
56
-
57
- if (rootProject.ext.has('reactNativeAndroidRoot')) {
58
- defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
59
- } else {
60
- defaultDir = new File(
61
- projectDir,
62
- '/../../../node_modules/react-native/android'
63
- )
64
- }
65
-
66
- if (defaultDir.exists()) {
67
- maven {
68
- url defaultDir.toString()
69
- name androidSourcesName
70
- }
71
-
72
- logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
73
- found = true
74
- } else {
75
- def parentDir = rootProject.projectDir
76
-
77
- 1.upto(5, {
78
- if (found) return true
79
- parentDir = parentDir.parentFile
80
-
81
- def androidSourcesDir = new File(
82
- parentDir,
83
- 'node_modules/react-native'
84
- )
85
-
86
- def androidPrebuiltBinaryDir = new File(
87
- parentDir,
88
- 'node_modules/react-native/android'
89
- )
90
-
91
- if (androidPrebuiltBinaryDir.exists()) {
92
- maven {
93
- url androidPrebuiltBinaryDir.toString()
94
- name androidSourcesName
95
- }
96
-
97
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
98
- found = true
99
- } else if (androidSourcesDir.exists()) {
100
- maven {
101
- url androidSourcesDir.toString()
102
- name androidSourcesName
103
- }
104
-
105
- logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
106
- found = true
107
- }
108
- })
109
- }
110
-
111
- if (!found) {
112
- throw new GradleException(
113
- "${project.name}: unable to locate React Native android sources. " +
114
- "Ensure you have you installed React Native as a dependency in your project and try again."
115
- )
116
- }
117
- }
118
-
119
- def kotlin_version = getExtOrDefault('kotlinVersion')
120
-
121
- dependencies {
122
- //noinspection GradleDynamicVersion
123
- api 'com.facebook.react:react-native:+'
124
- implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.1.1'
125
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
- }