react-native-purchases 6.0.0-beta.1 → 6.0.0

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.
@@ -24,6 +24,6 @@ Pod::Spec.new do |spec|
24
24
  ]
25
25
 
26
26
  spec.dependency "React-Core"
27
- spec.dependency "PurchasesHybridCommon", '5.0.0-beta.6'
27
+ spec.dependency "PurchasesHybridCommon", '5.0.0'
28
28
  spec.swift_version = '5.0'
29
29
  end
@@ -29,7 +29,7 @@ android {
29
29
  minSdkVersion getExtOrIntegerDefault('minSdkVersion')
30
30
  targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
31
31
  versionCode 1
32
- versionName '6.0.0-beta.1'
32
+ versionName '6.0.0'
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:5.0.0-beta.6'
124
+ implementation 'com.revenuecat.purchases:purchases-hybrid-common:5.0.0'
125
125
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
126
126
  }
@@ -1,5 +1,5 @@
1
1
  android.useAndroidX=true
2
- Purchases_kotlinVersion=1.6.21
2
+ Purchases_kotlinVersion=1.7.21
3
3
  Purchases_compileSdkVersion=28
4
4
  Purchases_targetSdkVersion=28
5
5
  Purchases_minSdkVersion=16
@@ -62,6 +62,7 @@ internal object RNPurchasesConverters {
62
62
  null -> writableArray.pushNull()
63
63
  is Boolean -> writableArray.pushBoolean(item)
64
64
  is Int -> writableArray.pushInt(item)
65
+ is Long -> writableArray.pushDouble(item.toDouble())
65
66
  is Double -> writableArray.pushDouble(item)
66
67
  is String -> writableArray.pushString(item)
67
68
  is Map<*, *> -> writableArray.pushMap(convertMapToWriteableMap(item as Map<String, *>))
@@ -81,6 +82,7 @@ internal object RNPurchasesConverters {
81
82
  null -> writableMap.putNull(key)
82
83
  is Boolean -> writableMap.putBoolean(key, value)
83
84
  is Int -> writableMap.putInt(key, value)
85
+ is Long -> writableMap.putDouble(key, value.toDouble())
84
86
  is Double -> writableMap.putDouble(key, value)
85
87
  is String -> writableMap.putString(key, value)
86
88
  is Map<*, *> -> writableMap.putMap(key, convertMapToWriteableMap(value as Map<String, *>))
@@ -45,7 +45,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd
45
45
  private static final String CUSTOMER_INFO_UPDATED = "Purchases-CustomerInfoUpdated";
46
46
  private static final String LOG_HANDLER_EVENT = "Purchases-LogHandlerEvent";
47
47
  public static final String PLATFORM_NAME = "react-native";
48
- public static final String PLUGIN_VERSION = "4.6.0";
48
+ public static final String PLUGIN_VERSION = "6.0.0";
49
49
 
50
50
  private final ReactApplicationContext reactContext;
51
51
 
@@ -221,6 +221,10 @@ export interface PurchasesOffering {
221
221
  * Offering description defined in RevenueCat dashboard.
222
222
  */
223
223
  readonly serverDescription: string;
224
+ /**
225
+ * Offering metadata defined in RevenueCat dashboard.
226
+ */
227
+ readonly metadata: Map<string, any>;
224
228
  /**
225
229
  * Array of `Package` objects available for purchase.
226
230
  */
@@ -384,6 +388,10 @@ export interface SubscriptionOption {
384
388
  * The subscription period of fullPricePhase (after free and intro trials).
385
389
  */
386
390
  readonly billingPeriod: Period | null;
391
+ /**
392
+ * True if the subscription is pre-paid.
393
+ */
394
+ readonly isPrepaid: boolean;
387
395
  /**
388
396
  * The full price PricingPhase of the subscription.
389
397
  * Looks for the last price phase of the SubscriptionOption.
@@ -436,16 +444,34 @@ export interface PricingPhase {
436
444
  * Recurrence mode for a pricing phase
437
445
  */
438
446
  export declare enum RECURRENCE_MODE {
447
+ /**
448
+ * Pricing phase repeats infinitely until cancellation
449
+ */
439
450
  INFINITE_RECURRING = 1,
451
+ /**
452
+ * Pricing phase repeats for a fixed number of billing periods
453
+ */
440
454
  FINITE_RECURRING = 2,
455
+ /**
456
+ * Pricing phase does not repeat
457
+ */
441
458
  NON_RECURRING = 3
442
459
  }
443
460
  /**
444
461
  * Payment mode for offer pricing phases. Google Play only.
445
462
  */
446
463
  export declare enum OFFER_PAYMENT_MODE {
464
+ /**
465
+ * Subscribers don't pay until the specified period ends
466
+ */
447
467
  FREE_TRIAL = "FREE_TRIAL",
468
+ /**
469
+ * Subscribers pay up front for a specified period
470
+ */
448
471
  SINGLE_PAYMENT = "SINGLE_PAYMENT",
472
+ /**
473
+ * Subscribers pay a discounted amount for a specified number of periods
474
+ */
449
475
  DISCOUNTED_RECURRING_PAYMENT = "DISCOUNTED_RECURRING_PAYMENT"
450
476
  }
451
477
  /**
package/dist/offerings.js CHANGED
@@ -110,8 +110,17 @@ var PRORATION_MODE;
110
110
  */
111
111
  var RECURRENCE_MODE;
112
112
  (function (RECURRENCE_MODE) {
113
+ /**
114
+ * Pricing phase repeats infinitely until cancellation
115
+ */
113
116
  RECURRENCE_MODE[RECURRENCE_MODE["INFINITE_RECURRING"] = 1] = "INFINITE_RECURRING";
117
+ /**
118
+ * Pricing phase repeats for a fixed number of billing periods
119
+ */
114
120
  RECURRENCE_MODE[RECURRENCE_MODE["FINITE_RECURRING"] = 2] = "FINITE_RECURRING";
121
+ /**
122
+ * Pricing phase does not repeat
123
+ */
115
124
  RECURRENCE_MODE[RECURRENCE_MODE["NON_RECURRING"] = 3] = "NON_RECURRING";
116
125
  })(RECURRENCE_MODE = exports.RECURRENCE_MODE || (exports.RECURRENCE_MODE = {}));
117
126
  /**
@@ -119,8 +128,17 @@ var RECURRENCE_MODE;
119
128
  */
120
129
  var OFFER_PAYMENT_MODE;
121
130
  (function (OFFER_PAYMENT_MODE) {
131
+ /**
132
+ * Subscribers don't pay until the specified period ends
133
+ */
122
134
  OFFER_PAYMENT_MODE["FREE_TRIAL"] = "FREE_TRIAL";
135
+ /**
136
+ * Subscribers pay up front for a specified period
137
+ */
123
138
  OFFER_PAYMENT_MODE["SINGLE_PAYMENT"] = "SINGLE_PAYMENT";
139
+ /**
140
+ * Subscribers pay a discounted amount for a specified number of periods
141
+ */
124
142
  OFFER_PAYMENT_MODE["DISCOUNTED_RECURRING_PAYMENT"] = "DISCOUNTED_RECURRING_PAYMENT";
125
143
  })(OFFER_PAYMENT_MODE = exports.OFFER_PAYMENT_MODE || (exports.OFFER_PAYMENT_MODE = {}));
126
144
  /**
@@ -280,9 +280,6 @@ export default class Purchases {
280
280
  * @param {UpgradeInfo} upgradeInfo Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU
281
281
  * and the optional prorationMode.
282
282
  * @param {String} type Optional type of product, can be inapp or subs. Subs by default
283
- * @param {boolean} googleIsPersonalizedPrice Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
284
- * For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true.
285
- * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
286
283
  * @deprecated, use purchaseStoreProduct instead
287
284
  */
288
285
  static purchaseProduct(productIdentifier: string, upgradeInfo?: UpgradeInfo | null, type?: PURCHASE_TYPE): Promise<MakePurchaseResult>;
@@ -345,7 +342,7 @@ export default class Purchases {
345
342
  * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
346
343
  * has not been called yet.
347
344
  */
348
- static purchaseSubscriptionOption(subscriptionOption: SubscriptionOption, googleProductChangeInfo?: GoogleProductChangeInfo | null, googleIsPersonalizedPrice?: boolean | null): Promise<MakePurchaseResult>;
345
+ static purchaseSubscriptionOption(subscriptionOption: SubscriptionOption, googleProductChangeInfo?: GoogleProductChangeInfo, googleIsPersonalizedPrice?: boolean): Promise<MakePurchaseResult>;
349
346
  /**
350
347
  * iOS only. Purchase a package applying a given discount.
351
348
  *
package/dist/purchases.js CHANGED
@@ -301,9 +301,6 @@ var Purchases = /** @class */ (function () {
301
301
  * @param {UpgradeInfo} upgradeInfo Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU
302
302
  * and the optional prorationMode.
303
303
  * @param {String} type Optional type of product, can be inapp or subs. Subs by default
304
- * @param {boolean} googleIsPersonalizedPrice Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
305
- * For compliance with EU regulations. User will see "This price has been customize for you" in the purchase dialog when true.
306
- * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
307
304
  * @deprecated, use purchaseStoreProduct instead
308
305
  */
309
306
  Purchases.purchaseProduct = function (productIdentifier, upgradeInfo, type) {
package/ios/RNPurchases.m CHANGED
@@ -442,7 +442,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
442
442
  }
443
443
 
444
444
  - (NSString *)platformFlavorVersion {
445
- return @"6.0.0-beta.1";
445
+ return @"6.0.0";
446
446
  }
447
447
 
448
448
  @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.0.0-beta.1",
4
+ "version": "6.0.0",
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/6.0.0-beta.1/" />
5
+ <meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/6.0.0/" />
6
6
  </head>
7
7
  <body>
8
8
  </body>
@@ -330,6 +330,16 @@ global.offeringsStub = {
330
330
  identifier: 'Custom'
331
331
  }
332
332
  ],
333
+ metadata: {
334
+ "int": 5,
335
+ "double": 5.5,
336
+ "boolean": true,
337
+ "string": "five",
338
+ "array": ["five"],
339
+ "dictionary": {
340
+ "string": "five"
341
+ }
342
+ },
333
343
  serverDescription: 'Default Offering',
334
344
  identifier: 'default'
335
345
  },
@@ -748,6 +758,7 @@ NativeModules.RNPurchases = {
748
758
  setFinishTransactions: jest.fn(),
749
759
  purchaseProduct: jest.fn(),
750
760
  purchasePackage: jest.fn(),
761
+ purchaseSubscriptionOption: jest.fn(),
751
762
  isAnonymous: jest.fn(),
752
763
  makeDeferredPurchase: jest.fn(),
753
764
  checkTrialOrIntroductoryPriceEligibility: jest.fn(),