react-native-purchases 5.0.0-beta.1 → 5.0.0-beta.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 +1 -1
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/build.gradle.bck +2 -2
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +3 -0
- package/dist/offerings.d.ts +3 -3
- package/dist/purchases.d.ts +3 -0
- package/dist/purchases.js +3 -0
- package/ios/RNPurchases.m +3 -3
- package/ios/RNPurchases.m.bck +1 -1
- package/package.json +2 -1
- package/scripts/docs/index.html +9 -0
- package/scripts/docs/index.html.bck +9 -0
- package/scripts/setupJest.js +248 -234
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ React Native Purchases is a client for the [RevenueCat](https://www.revenuecat.c
|
|
|
23
23
|
|
|
24
24
|
## Requirements
|
|
25
25
|
|
|
26
|
-
The minimum React Native version this SDK requires is `0.
|
|
26
|
+
The minimum React Native version this SDK requires is `0.64`.
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
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.0-beta.
|
|
32
|
+
versionName '5.0.0-beta.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:
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.0.0'
|
|
125
125
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
126
126
|
}
|
package/android/build.gradle.bck
CHANGED
|
@@ -29,7 +29,7 @@ android {
|
|
|
29
29
|
minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
|
30
30
|
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
31
31
|
versionCode 1
|
|
32
|
-
versionName '
|
|
32
|
+
versionName '5.0.0-beta.1'
|
|
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:
|
|
124
|
+
implementation 'com.revenuecat.purchases:purchases-hybrid-common:4.0.0'
|
|
125
125
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
126
126
|
}
|
package/dist/errors.d.ts
CHANGED
package/dist/errors.js
CHANGED
|
@@ -41,6 +41,9 @@ var PURCHASES_ERROR_CODE;
|
|
|
41
41
|
PURCHASES_ERROR_CODE["INVALID_SUBSCRIBER_ATTRIBUTES_ERROR"] = "21";
|
|
42
42
|
PURCHASES_ERROR_CODE["LOG_OUT_ANONYMOUS_USER_ERROR"] = "22";
|
|
43
43
|
})(PURCHASES_ERROR_CODE = exports.PURCHASES_ERROR_CODE || (exports.PURCHASES_ERROR_CODE = {}));
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
44
47
|
var UninitializedPurchasesError = /** @class */ (function (_super) {
|
|
45
48
|
__extends(UninitializedPurchasesError, _super);
|
|
46
49
|
function UninitializedPurchasesError() {
|
package/dist/offerings.d.ts
CHANGED
|
@@ -74,15 +74,15 @@ export interface PurchasesStoreProduct {
|
|
|
74
74
|
/**
|
|
75
75
|
* Formatted price of the item, including its currency sign.
|
|
76
76
|
*/
|
|
77
|
-
readonly
|
|
77
|
+
readonly priceString: string;
|
|
78
78
|
/**
|
|
79
79
|
* Currency code for price and original price.
|
|
80
80
|
*/
|
|
81
|
-
readonly
|
|
81
|
+
readonly currencyCode: string;
|
|
82
82
|
/**
|
|
83
83
|
* Introductory price.
|
|
84
84
|
*/
|
|
85
|
-
readonly
|
|
85
|
+
readonly introPrice: PurchasesIntroPrice | null;
|
|
86
86
|
/**
|
|
87
87
|
* Collection of discount offers for a product. Null for Android.
|
|
88
88
|
*/
|
package/dist/purchases.d.ts
CHANGED
|
@@ -101,6 +101,9 @@ export default class Purchases {
|
|
|
101
101
|
* @enum {string}
|
|
102
102
|
*/
|
|
103
103
|
static PURCHASES_ERROR_CODE: typeof PURCHASES_ERROR_CODE;
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
104
107
|
static UninitializedPurchasesError: typeof UninitializedPurchasesError;
|
|
105
108
|
/**
|
|
106
109
|
* Sets up Purchases with your API key and an app user id.
|
package/dist/purchases.js
CHANGED
|
@@ -1092,6 +1092,9 @@ var Purchases = /** @class */ (function () {
|
|
|
1092
1092
|
* @enum {string}
|
|
1093
1093
|
*/
|
|
1094
1094
|
Purchases.PURCHASES_ERROR_CODE = errors_1.PURCHASES_ERROR_CODE;
|
|
1095
|
+
/**
|
|
1096
|
+
* @internal
|
|
1097
|
+
*/
|
|
1095
1098
|
Purchases.UninitializedPurchasesError = errors_1.UninitializedPurchasesError;
|
|
1096
1099
|
return Purchases;
|
|
1097
1100
|
}());
|
package/ios/RNPurchases.m
CHANGED
|
@@ -103,8 +103,8 @@ RCT_REMAP_METHOD(purchasePackage,
|
|
|
103
103
|
completionBlock:[self getResponseCompletionBlockWithResolve:resolve reject:reject]];
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
RCT_REMAP_METHOD(
|
|
107
|
-
|
|
106
|
+
RCT_REMAP_METHOD(restorePurchases,
|
|
107
|
+
restorePurchasesWithResolve:(RCTPromiseResolveBlock)resolve
|
|
108
108
|
reject:(RCTPromiseRejectBlock)reject) {
|
|
109
109
|
[RCCommonFunctionality restorePurchasesWithCompletionBlock:[self getResponseCompletionBlockWithResolve:resolve
|
|
110
110
|
reject:reject]];
|
|
@@ -336,7 +336,7 @@ readyForPromotedProduct:(RCStoreProduct *)product
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
- (NSString *)platformFlavorVersion {
|
|
339
|
-
return @"5.0.0-beta.
|
|
339
|
+
return @"5.0.0-beta.2";
|
|
340
340
|
}
|
|
341
341
|
|
|
342
342
|
@end
|
package/ios/RNPurchases.m.bck
CHANGED
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.
|
|
4
|
+
"version": "5.0.0-beta.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",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"ts-jest": "^24.1.0",
|
|
71
71
|
"tslint": "^5.20.0",
|
|
72
72
|
"tslint-config-prettier": "^1.18.0",
|
|
73
|
+
"typedoc": "^0.20.37",
|
|
73
74
|
"typescript": "^3.8.3"
|
|
74
75
|
},
|
|
75
76
|
"jest": {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- This file is used to redirect visitors to the latest version of the docs -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.0-beta.2/" />
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
</body>
|
|
9
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<!-- This file is used to redirect visitors to the latest version of the docs -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="refresh" content="0; url=https://revenuecat.github.io/react-native-purchases-docs/5.0.0-beta.1/" />
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
</body>
|
|
9
|
+
</html>
|
package/scripts/setupJest.js
CHANGED
|
@@ -67,15 +67,9 @@ global.offeringsStub = {
|
|
|
67
67
|
weekly: {
|
|
68
68
|
offeringIdentifier: 'default',
|
|
69
69
|
product: {
|
|
70
|
-
intro_price_period_number_of_units: 7,
|
|
71
|
-
intro_price_period_unit: 'DAY',
|
|
72
|
-
intro_price_cycles: 3,
|
|
73
|
-
intro_price_period: 'P1W',
|
|
74
|
-
intro_price_string: '$4.99',
|
|
75
|
-
intro_price: 4.99,
|
|
76
70
|
description: 'Product with intro price',
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
currencyCode: 'USD',
|
|
72
|
+
priceString: '$9.99',
|
|
79
73
|
price: 9.99,
|
|
80
74
|
title: 'Introductory Price (PurchasesSample)',
|
|
81
75
|
identifier: 'introductory_price'
|
|
@@ -87,15 +81,17 @@ global.offeringsStub = {
|
|
|
87
81
|
twoMonth: {
|
|
88
82
|
offeringIdentifier: 'default',
|
|
89
83
|
product: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
introPrice: {
|
|
85
|
+
periodNumberOfUnits: 16,
|
|
86
|
+
periodUnit: 'DAY',
|
|
87
|
+
cycles: 1,
|
|
88
|
+
period: 'P2W2D',
|
|
89
|
+
priceString: '$0.00',
|
|
90
|
+
price: 0
|
|
91
|
+
},
|
|
96
92
|
description: 'The best service, annually.',
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
currencyCode: 'USD',
|
|
94
|
+
priceString: '$19.99',
|
|
99
95
|
price: 19.99,
|
|
100
96
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
101
97
|
identifier: 'annual_freetrial'
|
|
@@ -106,15 +102,17 @@ global.offeringsStub = {
|
|
|
106
102
|
threeMonth: {
|
|
107
103
|
offeringIdentifier: 'default',
|
|
108
104
|
product: {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
introPrice: {
|
|
106
|
+
periodNumberOfUnits: 16,
|
|
107
|
+
periodUnit: 'DAY',
|
|
108
|
+
cycles: 1,
|
|
109
|
+
period: 'P2W2D',
|
|
110
|
+
priceString: '$0.00',
|
|
111
|
+
price: 0
|
|
112
|
+
},
|
|
115
113
|
description: 'The best service, annually.',
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
currencyCode: 'USD',
|
|
115
|
+
priceString: '$19.99',
|
|
118
116
|
price: 19.99,
|
|
119
117
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
120
118
|
identifier: 'annual_freetrial'
|
|
@@ -125,15 +123,17 @@ global.offeringsStub = {
|
|
|
125
123
|
sixMonth: {
|
|
126
124
|
offeringIdentifier: 'default',
|
|
127
125
|
product: {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
introPrice: {
|
|
127
|
+
periodNumberOfUnits: 16,
|
|
128
|
+
periodUnit: 'DAY',
|
|
129
|
+
cycles: 1,
|
|
130
|
+
period: 'P2W2D',
|
|
131
|
+
priceString: '$0.00',
|
|
132
|
+
price: 0
|
|
133
|
+
},
|
|
134
134
|
description: 'The best service, annually.',
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
currencyCode: 'USD',
|
|
136
|
+
priceString: '$19.99',
|
|
137
137
|
price: 19.99,
|
|
138
138
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
139
139
|
identifier: 'annual_freetrial'
|
|
@@ -144,15 +144,17 @@ global.offeringsStub = {
|
|
|
144
144
|
annual: {
|
|
145
145
|
offeringIdentifier: 'default',
|
|
146
146
|
product: {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
introPrice: {
|
|
148
|
+
periodNumberOfUnits: 16,
|
|
149
|
+
periodUnit: 'DAY',
|
|
150
|
+
cycles: 1,
|
|
151
|
+
period: 'P2W2D',
|
|
152
|
+
priceString: '$0.00',
|
|
153
|
+
price: 0
|
|
154
|
+
},
|
|
153
155
|
description: 'The best service, annually.',
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
currencyCode: 'USD',
|
|
157
|
+
priceString: '$19.99',
|
|
156
158
|
price: 19.99,
|
|
157
159
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
158
160
|
identifier: 'annual_freetrial'
|
|
@@ -163,15 +165,10 @@ global.offeringsStub = {
|
|
|
163
165
|
lifetime: {
|
|
164
166
|
offeringIdentifier: 'default',
|
|
165
167
|
product: {
|
|
166
|
-
|
|
167
|
-
intro_price_period_unit: null,
|
|
168
|
-
intro_price_cycles: null,
|
|
169
|
-
intro_price_period: null,
|
|
170
|
-
intro_price_string: null,
|
|
171
|
-
intro_price: null,
|
|
168
|
+
introPrice: null,
|
|
172
169
|
description: 'you can eat it many times',
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
currencyCode: 'USD',
|
|
171
|
+
priceString: '$4.99',
|
|
175
172
|
price: 4.99,
|
|
176
173
|
title: 'Consumable (PurchasesSample)',
|
|
177
174
|
identifier: 'consumable'
|
|
@@ -183,15 +180,17 @@ global.offeringsStub = {
|
|
|
183
180
|
{
|
|
184
181
|
offeringIdentifier: 'default',
|
|
185
182
|
product: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
183
|
+
introPrice: {
|
|
184
|
+
periodNumberOfUnits: 16,
|
|
185
|
+
periodUnit: 'DAY',
|
|
186
|
+
cycles: 1,
|
|
187
|
+
period: 'P2W2D',
|
|
188
|
+
priceString: '$0.00',
|
|
189
|
+
price: 0
|
|
190
|
+
},
|
|
192
191
|
description: 'The best service, annually.',
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
currencyCode: 'USD',
|
|
193
|
+
priceString: '$19.99',
|
|
195
194
|
price: 19.99,
|
|
196
195
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
197
196
|
identifier: 'annual_freetrial'
|
|
@@ -202,15 +201,17 @@ global.offeringsStub = {
|
|
|
202
201
|
{
|
|
203
202
|
offeringIdentifier: 'default',
|
|
204
203
|
product: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
introPrice: {
|
|
205
|
+
periodNumberOfUnits: 16,
|
|
206
|
+
periodUnit: 'DAY',
|
|
207
|
+
cycles: 1,
|
|
208
|
+
period: 'P2W2D',
|
|
209
|
+
priceString: '$0.00',
|
|
210
|
+
price: 0
|
|
211
|
+
},
|
|
211
212
|
description: 'The best service, annually.',
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
currencyCode: 'USD',
|
|
214
|
+
priceString: '$19.99',
|
|
214
215
|
price: 19.99,
|
|
215
216
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
216
217
|
identifier: 'annual_freetrial'
|
|
@@ -221,15 +222,17 @@ global.offeringsStub = {
|
|
|
221
222
|
{
|
|
222
223
|
offeringIdentifier: 'default',
|
|
223
224
|
product: {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
introPrice: {
|
|
226
|
+
periodNumberOfUnits: 16,
|
|
227
|
+
periodUnit: 'DAY',
|
|
228
|
+
cycles: 1,
|
|
229
|
+
period: 'P2W2D',
|
|
230
|
+
priceString: '$0.00',
|
|
231
|
+
price: 0
|
|
232
|
+
},
|
|
230
233
|
description: 'The best service, annually.',
|
|
231
|
-
|
|
232
|
-
|
|
234
|
+
currencyCode: 'USD',
|
|
235
|
+
priceString: '$19.99',
|
|
233
236
|
price: 19.99,
|
|
234
237
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
235
238
|
identifier: 'annual_freetrial'
|
|
@@ -240,15 +243,17 @@ global.offeringsStub = {
|
|
|
240
243
|
{
|
|
241
244
|
offeringIdentifier: 'default',
|
|
242
245
|
product: {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
introPrice: {
|
|
247
|
+
periodNumberOfUnits: 16,
|
|
248
|
+
periodUnit: 'DAY',
|
|
249
|
+
cycles: 1,
|
|
250
|
+
period: 'P2W2D',
|
|
251
|
+
priceString: '$0.00',
|
|
252
|
+
price: 0
|
|
253
|
+
},
|
|
249
254
|
description: 'The best service, annually.',
|
|
250
|
-
|
|
251
|
-
|
|
255
|
+
currencyCode: 'USD',
|
|
256
|
+
priceString: '$19.99',
|
|
252
257
|
price: 19.99,
|
|
253
258
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
254
259
|
identifier: 'annual_freetrial'
|
|
@@ -259,15 +264,17 @@ global.offeringsStub = {
|
|
|
259
264
|
{
|
|
260
265
|
offeringIdentifier: 'default',
|
|
261
266
|
product: {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
267
|
+
introPrice: {
|
|
268
|
+
periodNumberOfUnits: 7,
|
|
269
|
+
periodUnit: 'DAY',
|
|
270
|
+
cycles: 3,
|
|
271
|
+
period: 'P1W',
|
|
272
|
+
priceString: '$4.99',
|
|
273
|
+
price: 4.99
|
|
274
|
+
},
|
|
268
275
|
description: 'Product with intro price',
|
|
269
|
-
|
|
270
|
-
|
|
276
|
+
currencyCode: 'USD',
|
|
277
|
+
priceString: '$9.99',
|
|
271
278
|
price: 9.99,
|
|
272
279
|
title: 'Introductory Price (PurchasesSample)',
|
|
273
280
|
identifier: 'introductory_price'
|
|
@@ -278,15 +285,10 @@ global.offeringsStub = {
|
|
|
278
285
|
{
|
|
279
286
|
offeringIdentifier: 'default',
|
|
280
287
|
product: {
|
|
281
|
-
|
|
282
|
-
intro_price_period_unit: null,
|
|
283
|
-
intro_price_cycles: null,
|
|
284
|
-
intro_price_period: null,
|
|
285
|
-
intro_price_string: null,
|
|
286
|
-
intro_price: null,
|
|
288
|
+
introPrice: null,
|
|
287
289
|
description: 'you can eat it many times',
|
|
288
|
-
|
|
289
|
-
|
|
290
|
+
currencyCode: 'USD',
|
|
291
|
+
priceString: '$4.99',
|
|
290
292
|
price: 4.99,
|
|
291
293
|
title: 'Consumable (PurchasesSample)',
|
|
292
294
|
identifier: 'consumable'
|
|
@@ -297,15 +299,17 @@ global.offeringsStub = {
|
|
|
297
299
|
{
|
|
298
300
|
offeringIdentifier: 'default',
|
|
299
301
|
product: {
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
introPrice: {
|
|
303
|
+
periodNumberOfUnits: 16,
|
|
304
|
+
periodUnit: 'DAY',
|
|
305
|
+
cycles: 1,
|
|
306
|
+
period: 'P2W2D',
|
|
307
|
+
priceString: '$0.00',
|
|
308
|
+
price: 0
|
|
309
|
+
},
|
|
306
310
|
description: 'The best service, annually.',
|
|
307
|
-
|
|
308
|
-
|
|
311
|
+
currencyCode: 'USD',
|
|
312
|
+
priceString: '$19.99',
|
|
309
313
|
price: 19.99,
|
|
310
314
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
311
315
|
identifier: 'annual_freetrial'
|
|
@@ -323,15 +327,17 @@ global.offeringsStub = {
|
|
|
323
327
|
monthly: {
|
|
324
328
|
offeringIdentifier: 'test',
|
|
325
329
|
product: {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
introPrice: {
|
|
331
|
+
periodNumberOfUnits: 7,
|
|
332
|
+
periodUnit: 'DAY',
|
|
333
|
+
cycles: 3,
|
|
334
|
+
period: 'P1W',
|
|
335
|
+
priceString: '$4.99',
|
|
336
|
+
price: 4.99
|
|
337
|
+
},
|
|
332
338
|
description: 'Product with intro price',
|
|
333
|
-
|
|
334
|
-
|
|
339
|
+
currencyCode: 'USD',
|
|
340
|
+
priceString: '$9.99',
|
|
335
341
|
price: 9.99,
|
|
336
342
|
title: 'Introductory Price (PurchasesSample)',
|
|
337
343
|
identifier: 'introductory_price'
|
|
@@ -348,15 +354,17 @@ global.offeringsStub = {
|
|
|
348
354
|
{
|
|
349
355
|
offeringIdentifier: 'test',
|
|
350
356
|
product: {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
+
introPrice: {
|
|
358
|
+
periodNumberOfUnits: 7,
|
|
359
|
+
periodUnit: 'DAY',
|
|
360
|
+
cycles: 3,
|
|
361
|
+
period: 'P1W',
|
|
362
|
+
priceString: '$4.99',
|
|
363
|
+
price: 4.99
|
|
364
|
+
},
|
|
357
365
|
description: 'Product with intro price',
|
|
358
|
-
|
|
359
|
-
|
|
366
|
+
currencyCode: 'USD',
|
|
367
|
+
priceString: '$9.99',
|
|
360
368
|
price: 9.99,
|
|
361
369
|
title: 'Introductory Price (PurchasesSample)',
|
|
362
370
|
identifier: 'introductory_price'
|
|
@@ -372,15 +380,17 @@ global.offeringsStub = {
|
|
|
372
380
|
weekly: {
|
|
373
381
|
offeringIdentifier: 'default',
|
|
374
382
|
product: {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
383
|
+
introPrice: {
|
|
384
|
+
periodNumberOfUnits: 7,
|
|
385
|
+
periodUnit: 'DAY',
|
|
386
|
+
cycles: 3,
|
|
387
|
+
period: 'P1W',
|
|
388
|
+
priceString: '$4.99',
|
|
389
|
+
price: 4.99
|
|
390
|
+
},
|
|
381
391
|
description: 'Product with intro price',
|
|
382
|
-
|
|
383
|
-
|
|
392
|
+
currencyCode: 'USD',
|
|
393
|
+
priceString: '$9.99',
|
|
384
394
|
price: 9.99,
|
|
385
395
|
title: 'Introductory Price (PurchasesSample)',
|
|
386
396
|
identifier: 'introductory_price'
|
|
@@ -392,15 +402,17 @@ global.offeringsStub = {
|
|
|
392
402
|
twoMonth: {
|
|
393
403
|
offeringIdentifier: 'default',
|
|
394
404
|
product: {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
405
|
+
introPrice: {
|
|
406
|
+
periodNumberOfUnits: 16,
|
|
407
|
+
periodUnit: 'DAY',
|
|
408
|
+
cycles: 1,
|
|
409
|
+
period: 'P2W2D',
|
|
410
|
+
priceString: '$0.00',
|
|
411
|
+
price: 0
|
|
412
|
+
},
|
|
401
413
|
description: 'The best service, annually.',
|
|
402
|
-
|
|
403
|
-
|
|
414
|
+
currencyCode: 'USD',
|
|
415
|
+
priceString: '$19.99',
|
|
404
416
|
price: 19.99,
|
|
405
417
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
406
418
|
identifier: 'annual_freetrial'
|
|
@@ -411,15 +423,17 @@ global.offeringsStub = {
|
|
|
411
423
|
threeMonth: {
|
|
412
424
|
offeringIdentifier: 'default',
|
|
413
425
|
product: {
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
426
|
+
introPrice: {
|
|
427
|
+
periodNumberOfUnits: 16,
|
|
428
|
+
periodUnit: 'DAY',
|
|
429
|
+
cycles: 1,
|
|
430
|
+
period: 'P2W2D',
|
|
431
|
+
priceString: '$0.00',
|
|
432
|
+
price: 0
|
|
433
|
+
},
|
|
420
434
|
description: 'The best service, annually.',
|
|
421
|
-
|
|
422
|
-
|
|
435
|
+
currencyCode: 'USD',
|
|
436
|
+
priceString: '$19.99',
|
|
423
437
|
price: 19.99,
|
|
424
438
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
425
439
|
identifier: 'annual_freetrial'
|
|
@@ -430,15 +444,17 @@ global.offeringsStub = {
|
|
|
430
444
|
sixMonth: {
|
|
431
445
|
offeringIdentifier: 'default',
|
|
432
446
|
product: {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
447
|
+
introPrice: {
|
|
448
|
+
periodNumberOfUnits: 16,
|
|
449
|
+
periodUnit: 'DAY',
|
|
450
|
+
cycles: 1,
|
|
451
|
+
period: 'P2W2D',
|
|
452
|
+
priceString: '$0.00',
|
|
453
|
+
price: 0
|
|
454
|
+
},
|
|
439
455
|
description: 'The best service, annually.',
|
|
440
|
-
|
|
441
|
-
|
|
456
|
+
currencyCode: 'USD',
|
|
457
|
+
priceString: '$19.99',
|
|
442
458
|
price: 19.99,
|
|
443
459
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
444
460
|
identifier: 'annual_freetrial'
|
|
@@ -449,15 +465,17 @@ global.offeringsStub = {
|
|
|
449
465
|
annual: {
|
|
450
466
|
offeringIdentifier: 'default',
|
|
451
467
|
product: {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
468
|
+
introPrice: {
|
|
469
|
+
periodNumberOfUnits: 16,
|
|
470
|
+
periodUnit: 'DAY',
|
|
471
|
+
cycles: 1,
|
|
472
|
+
period: 'P2W2D',
|
|
473
|
+
priceString: '$0.00',
|
|
474
|
+
price: 0
|
|
475
|
+
},
|
|
458
476
|
description: 'The best service, annually.',
|
|
459
|
-
|
|
460
|
-
|
|
477
|
+
currencyCode: 'USD',
|
|
478
|
+
priceString: '$19.99',
|
|
461
479
|
price: 19.99,
|
|
462
480
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
463
481
|
identifier: 'annual_freetrial'
|
|
@@ -468,15 +486,10 @@ global.offeringsStub = {
|
|
|
468
486
|
lifetime: {
|
|
469
487
|
offeringIdentifier: 'default',
|
|
470
488
|
product: {
|
|
471
|
-
|
|
472
|
-
intro_price_period_unit: null,
|
|
473
|
-
intro_price_cycles: null,
|
|
474
|
-
intro_price_period: null,
|
|
475
|
-
intro_price_string: null,
|
|
476
|
-
intro_price: null,
|
|
489
|
+
introPrice: null,
|
|
477
490
|
description: 'you can eat it many times',
|
|
478
|
-
|
|
479
|
-
|
|
491
|
+
currencyCode: 'USD',
|
|
492
|
+
priceString: '$4.99',
|
|
480
493
|
price: 4.99,
|
|
481
494
|
title: 'Consumable (PurchasesSample)',
|
|
482
495
|
identifier: 'consumable'
|
|
@@ -488,15 +501,17 @@ global.offeringsStub = {
|
|
|
488
501
|
{
|
|
489
502
|
offeringIdentifier: 'default',
|
|
490
503
|
product: {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
504
|
+
introPrice: {
|
|
505
|
+
periodNumberOfUnits: 16,
|
|
506
|
+
periodUnit: 'DAY',
|
|
507
|
+
cycles: 1,
|
|
508
|
+
period: 'P2W2D',
|
|
509
|
+
priceString: '$0.00',
|
|
510
|
+
price: 0
|
|
511
|
+
},
|
|
497
512
|
description: 'The best service, annually.',
|
|
498
|
-
|
|
499
|
-
|
|
513
|
+
currencyCode: 'USD',
|
|
514
|
+
priceString: '$19.99',
|
|
500
515
|
price: 19.99,
|
|
501
516
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
502
517
|
identifier: 'annual_freetrial'
|
|
@@ -507,15 +522,17 @@ global.offeringsStub = {
|
|
|
507
522
|
{
|
|
508
523
|
offeringIdentifier: 'default',
|
|
509
524
|
product: {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
525
|
+
introPrice: {
|
|
526
|
+
periodNumberOfUnits: 16,
|
|
527
|
+
periodUnit: 'DAY',
|
|
528
|
+
cycles: 1,
|
|
529
|
+
period: 'P2W2D',
|
|
530
|
+
priceString: '$0.00',
|
|
531
|
+
price: 0
|
|
532
|
+
},
|
|
516
533
|
description: 'The best service, annually.',
|
|
517
|
-
|
|
518
|
-
|
|
534
|
+
currencyCode: 'USD',
|
|
535
|
+
priceString: '$19.99',
|
|
519
536
|
price: 19.99,
|
|
520
537
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
521
538
|
identifier: 'annual_freetrial'
|
|
@@ -526,15 +543,17 @@ global.offeringsStub = {
|
|
|
526
543
|
{
|
|
527
544
|
offeringIdentifier: 'default',
|
|
528
545
|
product: {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
546
|
+
introPrice: {
|
|
547
|
+
periodNumberOfUnits: 16,
|
|
548
|
+
periodUnit: 'DAY',
|
|
549
|
+
cycles: 1,
|
|
550
|
+
period: 'P2W2D',
|
|
551
|
+
priceString: '$0.00',
|
|
552
|
+
price: 0
|
|
553
|
+
},
|
|
535
554
|
description: 'The best service, annually.',
|
|
536
|
-
|
|
537
|
-
|
|
555
|
+
currencyCode: 'USD',
|
|
556
|
+
priceString: '$19.99',
|
|
538
557
|
price: 19.99,
|
|
539
558
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
540
559
|
identifier: 'annual_freetrial'
|
|
@@ -545,15 +564,17 @@ global.offeringsStub = {
|
|
|
545
564
|
{
|
|
546
565
|
offeringIdentifier: 'default',
|
|
547
566
|
product: {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
567
|
+
introPrice: {
|
|
568
|
+
periodNumberOfUnits: 16,
|
|
569
|
+
periodUnit: 'DAY',
|
|
570
|
+
cycles: 1,
|
|
571
|
+
period: 'P2W2D',
|
|
572
|
+
priceString: '$0.00',
|
|
573
|
+
price: 0
|
|
574
|
+
},
|
|
554
575
|
description: 'The best service, annually.',
|
|
555
|
-
|
|
556
|
-
|
|
576
|
+
currencyCode: 'USD',
|
|
577
|
+
priceString: '$19.99',
|
|
557
578
|
price: 19.99,
|
|
558
579
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
559
580
|
identifier: 'annual_freetrial'
|
|
@@ -564,15 +585,17 @@ global.offeringsStub = {
|
|
|
564
585
|
{
|
|
565
586
|
offeringIdentifier: 'default',
|
|
566
587
|
product: {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
588
|
+
introPrice: {
|
|
589
|
+
periodNumberOfUnits: 7,
|
|
590
|
+
periodUnit: 'DAY',
|
|
591
|
+
cycles: 3,
|
|
592
|
+
period: 'P1W',
|
|
593
|
+
priceString: '$4.99',
|
|
594
|
+
price: 4.99
|
|
595
|
+
},
|
|
573
596
|
description: 'Product with intro price',
|
|
574
|
-
|
|
575
|
-
|
|
597
|
+
currencyCode: 'USD',
|
|
598
|
+
priceString: '$9.99',
|
|
576
599
|
price: 9.99,
|
|
577
600
|
title: 'Introductory Price (PurchasesSample)',
|
|
578
601
|
identifier: 'introductory_price'
|
|
@@ -583,15 +606,10 @@ global.offeringsStub = {
|
|
|
583
606
|
{
|
|
584
607
|
offeringIdentifier: 'default',
|
|
585
608
|
product: {
|
|
586
|
-
|
|
587
|
-
intro_price_period_unit: null,
|
|
588
|
-
intro_price_cycles: null,
|
|
589
|
-
intro_price_period: null,
|
|
590
|
-
intro_price_string: null,
|
|
591
|
-
intro_price: null,
|
|
609
|
+
introPrice: null,
|
|
592
610
|
description: 'you can eat it many times',
|
|
593
|
-
|
|
594
|
-
|
|
611
|
+
currencyCode: 'USD',
|
|
612
|
+
priceString: '$4.99',
|
|
595
613
|
price: 4.99,
|
|
596
614
|
title: 'Consumable (PurchasesSample)',
|
|
597
615
|
identifier: 'consumable'
|
|
@@ -602,15 +620,17 @@ global.offeringsStub = {
|
|
|
602
620
|
{
|
|
603
621
|
offeringIdentifier: 'default',
|
|
604
622
|
product: {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
623
|
+
introPrice: {
|
|
624
|
+
periodNumberOfUnits: 16,
|
|
625
|
+
periodUnit: 'DAY',
|
|
626
|
+
cycles: 1,
|
|
627
|
+
period: 'P2W2D',
|
|
628
|
+
priceString: '$0.00',
|
|
629
|
+
price: 0
|
|
630
|
+
},
|
|
611
631
|
description: 'The best service, annually.',
|
|
612
|
-
|
|
613
|
-
|
|
632
|
+
currencyCode: 'USD',
|
|
633
|
+
priceString: '$19.99',
|
|
614
634
|
price: 19.99,
|
|
615
635
|
title: 'Annual Free Trial (PurchasesSample)',
|
|
616
636
|
identifier: 'annual_freetrial'
|
|
@@ -626,16 +646,10 @@ global.offeringsStub = {
|
|
|
626
646
|
};
|
|
627
647
|
|
|
628
648
|
global.productStub = {
|
|
629
|
-
|
|
630
|
-
intro_price: null,
|
|
631
|
-
intro_price_string: null,
|
|
632
|
-
intro_price_period: null,
|
|
633
|
-
intro_price_cycles: null,
|
|
634
|
-
intro_price_period_unit: null,
|
|
635
|
-
intro_price_period_number_of_units: null,
|
|
636
|
-
discounts: null,
|
|
649
|
+
currencyCode: "USD",
|
|
637
650
|
introPrice: null,
|
|
638
|
-
|
|
651
|
+
discounts: null,
|
|
652
|
+
priceString: "$0.99",
|
|
639
653
|
price: 0.99,
|
|
640
654
|
description: "The best service.",
|
|
641
655
|
title: "One Month Free Trial",
|
|
@@ -678,7 +692,7 @@ NativeModules.RNPurchases = {
|
|
|
678
692
|
getOfferings: jest.fn(),
|
|
679
693
|
getProductInfo: jest.fn(),
|
|
680
694
|
makePurchase: jest.fn(),
|
|
681
|
-
|
|
695
|
+
restorePurchases: jest.fn(),
|
|
682
696
|
getAppUserID: jest.fn(),
|
|
683
697
|
setDebugLogsEnabled: jest.fn(),
|
|
684
698
|
getCustomerInfo: jest.fn(),
|