@capgo/native-purchases 0.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/NativePurchases.podspec +17 -0
- package/README.md +137 -0
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/ee/forgr/nativepurchases/NativePurchasesPlugin.java +195 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/docs.json +371 -0
- package/dist/esm/definitions.d.ts +305 -0
- package/dist/esm/definitions.js +128 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +19 -0
- package/dist/esm/web.js +28 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +162 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +165 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/NativePurchasesPlugin.h +10 -0
- package/ios/Plugin/NativePurchasesPlugin.m +10 -0
- package/ios/Plugin/NativePurchasesPlugin.swift +102 -0
- package/ios/Plugin/Product+CapacitorPurchasesPlugin.swift +52 -0
- package/package.json +78 -0
package/dist/docs.json
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
{
|
|
2
|
+
"api": {
|
|
3
|
+
"name": "NativePurchasesPlugin",
|
|
4
|
+
"slug": "nativepurchasesplugin",
|
|
5
|
+
"docs": "",
|
|
6
|
+
"tags": [],
|
|
7
|
+
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "restorePurchases",
|
|
10
|
+
"signature": "() => any",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "any",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "Restores a user's previous and links their appUserIDs to any user's also using those .",
|
|
15
|
+
"complexTypes": [
|
|
16
|
+
"CustomerInfo"
|
|
17
|
+
],
|
|
18
|
+
"slug": "restorepurchases"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "purchaseProduct",
|
|
22
|
+
"signature": "(options: { productIdentifier: string; quantity: number; }) => any",
|
|
23
|
+
"parameters": [
|
|
24
|
+
{
|
|
25
|
+
"name": "options",
|
|
26
|
+
"docs": "",
|
|
27
|
+
"type": "{ productIdentifier: string; quantity: number; }"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"returns": "any",
|
|
31
|
+
"tags": [],
|
|
32
|
+
"docs": "",
|
|
33
|
+
"complexTypes": [
|
|
34
|
+
"CustomerInfo"
|
|
35
|
+
],
|
|
36
|
+
"slug": "purchaseproduct"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "getProducts",
|
|
40
|
+
"signature": "(options: { productIdentifiers: string[]; }) => any",
|
|
41
|
+
"parameters": [
|
|
42
|
+
{
|
|
43
|
+
"name": "options",
|
|
44
|
+
"docs": "",
|
|
45
|
+
"type": "{ productIdentifiers: {}; }"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"returns": "any",
|
|
49
|
+
"tags": [],
|
|
50
|
+
"docs": "",
|
|
51
|
+
"complexTypes": [
|
|
52
|
+
"Product"
|
|
53
|
+
],
|
|
54
|
+
"slug": "getproducts"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"properties": []
|
|
58
|
+
},
|
|
59
|
+
"interfaces": [
|
|
60
|
+
{
|
|
61
|
+
"name": "CustomerInfo",
|
|
62
|
+
"slug": "customerinfo",
|
|
63
|
+
"docs": "",
|
|
64
|
+
"tags": [],
|
|
65
|
+
"methods": [],
|
|
66
|
+
"properties": [
|
|
67
|
+
{
|
|
68
|
+
"name": "activeSubscriptions",
|
|
69
|
+
"tags": [],
|
|
70
|
+
"docs": "Set of active subscription skus",
|
|
71
|
+
"complexTypes": [],
|
|
72
|
+
"type": "[string]"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "allPurchasedProductIdentifiers",
|
|
76
|
+
"tags": [],
|
|
77
|
+
"docs": "Set of purchased skus, active and inactive",
|
|
78
|
+
"complexTypes": [],
|
|
79
|
+
"type": "[string]"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "nonSubscriptionTransactions",
|
|
83
|
+
"tags": [],
|
|
84
|
+
"docs": "Returns all the non-subscription a user has made.\nThe are ordered by purchase date in ascending order.",
|
|
85
|
+
"complexTypes": [
|
|
86
|
+
"Transaction"
|
|
87
|
+
],
|
|
88
|
+
"type": "{}"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "latestExpirationDate",
|
|
92
|
+
"tags": [],
|
|
93
|
+
"docs": "The latest expiration date of all purchased skus",
|
|
94
|
+
"complexTypes": [],
|
|
95
|
+
"type": "string | null"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "firstSeen",
|
|
99
|
+
"tags": [],
|
|
100
|
+
"docs": "The date this user was first seen in RevenueCat.",
|
|
101
|
+
"complexTypes": [],
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "originalAppUserId",
|
|
106
|
+
"tags": [],
|
|
107
|
+
"docs": "The original App User Id recorded for this user.",
|
|
108
|
+
"complexTypes": [],
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "requestDate",
|
|
113
|
+
"tags": [],
|
|
114
|
+
"docs": "Date when this info was requested",
|
|
115
|
+
"complexTypes": [],
|
|
116
|
+
"type": "string"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "originalApplicationVersion",
|
|
120
|
+
"tags": [],
|
|
121
|
+
"docs": "Returns the version number for the version of the application when the\nuser bought the app. Use this for grandfathering users when migrating\nto subscriptions.\n\nThis corresponds to the value of CFBundleVersion (in iOS) in the\nInfo.plist file when the purchase was originally made. This is always null\nin Android",
|
|
122
|
+
"complexTypes": [],
|
|
123
|
+
"type": "string | null"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "originalPurchaseDate",
|
|
127
|
+
"tags": [],
|
|
128
|
+
"docs": "Returns the purchase date for the version of the application when the user bought the app.\nUse this for grandfathering users when migrating to subscriptions.",
|
|
129
|
+
"complexTypes": [],
|
|
130
|
+
"type": "string | null"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "managementURL",
|
|
134
|
+
"tags": [],
|
|
135
|
+
"docs": "URL to manage the active subscription of the user. If this user has an active iOS\nsubscription, this will point to the App Store, if the user has an active Play Store subscription\nit will point there. If there are no active subscriptions it will be null.\nIf there are multiple for different platforms, it will point to the device store.",
|
|
136
|
+
"complexTypes": [],
|
|
137
|
+
"type": "string | null"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "Transaction",
|
|
143
|
+
"slug": "transaction",
|
|
144
|
+
"docs": "",
|
|
145
|
+
"tags": [],
|
|
146
|
+
"methods": [],
|
|
147
|
+
"properties": [
|
|
148
|
+
{
|
|
149
|
+
"name": "transactionIdentifier",
|
|
150
|
+
"tags": [],
|
|
151
|
+
"docs": "RevenueCat Id associated to the transaction.",
|
|
152
|
+
"complexTypes": [],
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "productIdentifier",
|
|
157
|
+
"tags": [],
|
|
158
|
+
"docs": "Product Id associated with the transaction.",
|
|
159
|
+
"complexTypes": [],
|
|
160
|
+
"type": "string"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "purchaseDate",
|
|
164
|
+
"tags": [],
|
|
165
|
+
"docs": "Purchase date of the transaction in ISO 8601 format.",
|
|
166
|
+
"complexTypes": [],
|
|
167
|
+
"type": "string"
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "Product",
|
|
173
|
+
"slug": "product",
|
|
174
|
+
"docs": "",
|
|
175
|
+
"tags": [],
|
|
176
|
+
"methods": [],
|
|
177
|
+
"properties": [
|
|
178
|
+
{
|
|
179
|
+
"name": "identifier",
|
|
180
|
+
"tags": [],
|
|
181
|
+
"docs": "Product Id.",
|
|
182
|
+
"complexTypes": [],
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "description",
|
|
187
|
+
"tags": [],
|
|
188
|
+
"docs": "Description of the product.",
|
|
189
|
+
"complexTypes": [],
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "title",
|
|
194
|
+
"tags": [],
|
|
195
|
+
"docs": "Title of the product.",
|
|
196
|
+
"complexTypes": [],
|
|
197
|
+
"type": "string"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "price",
|
|
201
|
+
"tags": [],
|
|
202
|
+
"docs": "Price of the product in the local currency.",
|
|
203
|
+
"complexTypes": [],
|
|
204
|
+
"type": "number"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "priceString",
|
|
208
|
+
"tags": [],
|
|
209
|
+
"docs": "Formatted price of the item, including its currency sign, such as €3.99.",
|
|
210
|
+
"complexTypes": [],
|
|
211
|
+
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "currencyCode",
|
|
215
|
+
"tags": [],
|
|
216
|
+
"docs": "Currency code for price and original price.",
|
|
217
|
+
"complexTypes": [],
|
|
218
|
+
"type": "string"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "currencySymbol",
|
|
222
|
+
"tags": [],
|
|
223
|
+
"docs": "Currency symbol for price and original price.",
|
|
224
|
+
"complexTypes": [],
|
|
225
|
+
"type": "string"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "isFamilyShareable",
|
|
229
|
+
"tags": [],
|
|
230
|
+
"docs": "Boolean indicating if the product is sharable with family",
|
|
231
|
+
"complexTypes": [],
|
|
232
|
+
"type": "boolean"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "subscriptionGroupIdentifier",
|
|
236
|
+
"tags": [],
|
|
237
|
+
"docs": "Group identifier for the product.",
|
|
238
|
+
"complexTypes": [],
|
|
239
|
+
"type": "string"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "subscriptionPeriod",
|
|
243
|
+
"tags": [],
|
|
244
|
+
"docs": "The Product subcription group identifier.",
|
|
245
|
+
"complexTypes": [
|
|
246
|
+
"SubscriptionPeriod"
|
|
247
|
+
],
|
|
248
|
+
"type": "SubscriptionPeriod"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "introductoryPrice",
|
|
252
|
+
"tags": [],
|
|
253
|
+
"docs": "The Product introductory Price.",
|
|
254
|
+
"complexTypes": [
|
|
255
|
+
"SKProductDiscount"
|
|
256
|
+
],
|
|
257
|
+
"type": "SKProductDiscount | null"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "discounts",
|
|
261
|
+
"tags": [],
|
|
262
|
+
"docs": "The Product discounts list.",
|
|
263
|
+
"complexTypes": [
|
|
264
|
+
"SKProductDiscount"
|
|
265
|
+
],
|
|
266
|
+
"type": "{}"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "SubscriptionPeriod",
|
|
272
|
+
"slug": "subscriptionperiod",
|
|
273
|
+
"docs": "",
|
|
274
|
+
"tags": [],
|
|
275
|
+
"methods": [],
|
|
276
|
+
"properties": [
|
|
277
|
+
{
|
|
278
|
+
"name": "numberOfUnits",
|
|
279
|
+
"tags": [],
|
|
280
|
+
"docs": "The Subscription Period number of unit.",
|
|
281
|
+
"complexTypes": [],
|
|
282
|
+
"type": "number"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "unit",
|
|
286
|
+
"tags": [],
|
|
287
|
+
"docs": "The Subscription Period unit.",
|
|
288
|
+
"complexTypes": [],
|
|
289
|
+
"type": "number"
|
|
290
|
+
}
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "SKProductDiscount",
|
|
295
|
+
"slug": "skproductdiscount",
|
|
296
|
+
"docs": "",
|
|
297
|
+
"tags": [],
|
|
298
|
+
"methods": [],
|
|
299
|
+
"properties": [
|
|
300
|
+
{
|
|
301
|
+
"name": "identifier",
|
|
302
|
+
"tags": [],
|
|
303
|
+
"docs": "The Product discount identifier.",
|
|
304
|
+
"complexTypes": [],
|
|
305
|
+
"type": "string"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "type",
|
|
309
|
+
"tags": [],
|
|
310
|
+
"docs": "The Product discount type.",
|
|
311
|
+
"complexTypes": [],
|
|
312
|
+
"type": "number"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "price",
|
|
316
|
+
"tags": [],
|
|
317
|
+
"docs": "The Product discount price.",
|
|
318
|
+
"complexTypes": [],
|
|
319
|
+
"type": "number"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "priceString",
|
|
323
|
+
"tags": [],
|
|
324
|
+
"docs": "Formatted price of the item, including its currency sign, such as €3.99.",
|
|
325
|
+
"complexTypes": [],
|
|
326
|
+
"type": "string"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"name": "currencySymbol",
|
|
330
|
+
"tags": [],
|
|
331
|
+
"docs": "The Product discount currency symbol.",
|
|
332
|
+
"complexTypes": [],
|
|
333
|
+
"type": "string"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"name": "currencyCode",
|
|
337
|
+
"tags": [],
|
|
338
|
+
"docs": "The Product discount currency code.",
|
|
339
|
+
"complexTypes": [],
|
|
340
|
+
"type": "string"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "paymentMode",
|
|
344
|
+
"tags": [],
|
|
345
|
+
"docs": "The Product discount paymentMode.",
|
|
346
|
+
"complexTypes": [],
|
|
347
|
+
"type": "number"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"name": "numberOfPeriods",
|
|
351
|
+
"tags": [],
|
|
352
|
+
"docs": "The Product discount number Of Periods.",
|
|
353
|
+
"complexTypes": [],
|
|
354
|
+
"type": "number"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "subscriptionPeriod",
|
|
358
|
+
"tags": [],
|
|
359
|
+
"docs": "The Product discount subscription period.",
|
|
360
|
+
"complexTypes": [
|
|
361
|
+
"SubscriptionPeriod"
|
|
362
|
+
],
|
|
363
|
+
"type": "SubscriptionPeriod"
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"enums": [],
|
|
369
|
+
"typeAliases": [],
|
|
370
|
+
"pluginConfigs": []
|
|
371
|
+
}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
export declare enum ATTRIBUTION_NETWORK {
|
|
2
|
+
APPLE_SEARCH_ADS = 0,
|
|
3
|
+
ADJUST = 1,
|
|
4
|
+
APPSFLYER = 2,
|
|
5
|
+
BRANCH = 3,
|
|
6
|
+
TENJIN = 4,
|
|
7
|
+
FACEBOOK = 5
|
|
8
|
+
}
|
|
9
|
+
export declare enum PURCHASE_TYPE {
|
|
10
|
+
/**
|
|
11
|
+
* A type of SKU for in-app products.
|
|
12
|
+
*/
|
|
13
|
+
INAPP = "inapp",
|
|
14
|
+
/**
|
|
15
|
+
* A type of SKU for subscriptions.
|
|
16
|
+
*/
|
|
17
|
+
SUBS = "subs"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Enum for billing features.
|
|
21
|
+
* Currently, these are only relevant for Google Play Android users:
|
|
22
|
+
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
23
|
+
*/
|
|
24
|
+
export declare enum BILLING_FEATURE {
|
|
25
|
+
/**
|
|
26
|
+
* Purchase/query for subscriptions.
|
|
27
|
+
*/
|
|
28
|
+
SUBSCRIPTIONS = 0,
|
|
29
|
+
/**
|
|
30
|
+
* Subscriptions update/replace.
|
|
31
|
+
*/
|
|
32
|
+
SUBSCRIPTIONS_UPDATE = 1,
|
|
33
|
+
/**
|
|
34
|
+
* Purchase/query for in-app items on VR.
|
|
35
|
+
*/
|
|
36
|
+
IN_APP_ITEMS_ON_VR = 2,
|
|
37
|
+
/**
|
|
38
|
+
* Purchase/query for subscriptions on VR.
|
|
39
|
+
*/
|
|
40
|
+
SUBSCRIPTIONS_ON_VR = 3,
|
|
41
|
+
/**
|
|
42
|
+
* Launch a price change confirmation flow.
|
|
43
|
+
*/
|
|
44
|
+
PRICE_CHANGE_CONFIRMATION = 4
|
|
45
|
+
}
|
|
46
|
+
export declare enum PRORATION_MODE {
|
|
47
|
+
UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,
|
|
48
|
+
/**
|
|
49
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
50
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
51
|
+
*/
|
|
52
|
+
IMMEDIATE_WITH_TIME_PRORATION = 1,
|
|
53
|
+
/**
|
|
54
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
55
|
+
* same. The price for the remaining period will be charged. This option is
|
|
56
|
+
* only available for subscription upgrade.
|
|
57
|
+
*/
|
|
58
|
+
IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,
|
|
59
|
+
/**
|
|
60
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
61
|
+
* next recurrence time. The billing cycle stays the same.
|
|
62
|
+
*/
|
|
63
|
+
IMMEDIATE_WITHOUT_PRORATION = 3,
|
|
64
|
+
/**
|
|
65
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
66
|
+
* be charged at the same time.
|
|
67
|
+
*/
|
|
68
|
+
DEFERRED = 4
|
|
69
|
+
}
|
|
70
|
+
export declare enum PACKAGE_TYPE {
|
|
71
|
+
/**
|
|
72
|
+
* A package that was defined with a custom identifier.
|
|
73
|
+
*/
|
|
74
|
+
UNKNOWN = "UNKNOWN",
|
|
75
|
+
/**
|
|
76
|
+
* A package that was defined with a custom identifier.
|
|
77
|
+
*/
|
|
78
|
+
CUSTOM = "CUSTOM",
|
|
79
|
+
/**
|
|
80
|
+
* A package configured with the predefined lifetime identifier.
|
|
81
|
+
*/
|
|
82
|
+
LIFETIME = "LIFETIME",
|
|
83
|
+
/**
|
|
84
|
+
* A package configured with the predefined annual identifier.
|
|
85
|
+
*/
|
|
86
|
+
ANNUAL = "ANNUAL",
|
|
87
|
+
/**
|
|
88
|
+
* A package configured with the predefined six month identifier.
|
|
89
|
+
*/
|
|
90
|
+
SIX_MONTH = "SIX_MONTH",
|
|
91
|
+
/**
|
|
92
|
+
* A package configured with the predefined three month identifier.
|
|
93
|
+
*/
|
|
94
|
+
THREE_MONTH = "THREE_MONTH",
|
|
95
|
+
/**
|
|
96
|
+
* A package configured with the predefined two month identifier.
|
|
97
|
+
*/
|
|
98
|
+
TWO_MONTH = "TWO_MONTH",
|
|
99
|
+
/**
|
|
100
|
+
* A package configured with the predefined monthly identifier.
|
|
101
|
+
*/
|
|
102
|
+
MONTHLY = "MONTHLY",
|
|
103
|
+
/**
|
|
104
|
+
* A package configured with the predefined weekly identifier.
|
|
105
|
+
*/
|
|
106
|
+
WEEKLY = "WEEKLY"
|
|
107
|
+
}
|
|
108
|
+
export declare enum INTRO_ELIGIBILITY_STATUS {
|
|
109
|
+
/**
|
|
110
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
111
|
+
*/
|
|
112
|
+
INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,
|
|
113
|
+
/**
|
|
114
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
115
|
+
*/
|
|
116
|
+
INTRO_ELIGIBILITY_STATUS_INELIGIBLE = 1,
|
|
117
|
+
/**
|
|
118
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
119
|
+
*/
|
|
120
|
+
INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2
|
|
121
|
+
}
|
|
122
|
+
export interface Transaction {
|
|
123
|
+
/**
|
|
124
|
+
* RevenueCat Id associated to the transaction.
|
|
125
|
+
*/
|
|
126
|
+
readonly transactionIdentifier: string;
|
|
127
|
+
/**
|
|
128
|
+
* Product Id associated with the transaction.
|
|
129
|
+
*/
|
|
130
|
+
readonly productIdentifier: string;
|
|
131
|
+
/**
|
|
132
|
+
* Purchase date of the transaction in ISO 8601 format.
|
|
133
|
+
*/
|
|
134
|
+
readonly purchaseDate: string;
|
|
135
|
+
}
|
|
136
|
+
export interface CustomerInfo {
|
|
137
|
+
/**
|
|
138
|
+
* Set of active subscription skus
|
|
139
|
+
*/
|
|
140
|
+
readonly activeSubscriptions: [string];
|
|
141
|
+
/**
|
|
142
|
+
* Set of purchased skus, active and inactive
|
|
143
|
+
*/
|
|
144
|
+
readonly allPurchasedProductIdentifiers: [string];
|
|
145
|
+
/**
|
|
146
|
+
* Returns all the non-subscription a user has made.
|
|
147
|
+
* The are ordered by purchase date in ascending order.
|
|
148
|
+
*/
|
|
149
|
+
readonly nonSubscriptionTransactions: Transaction[];
|
|
150
|
+
/**
|
|
151
|
+
* The latest expiration date of all purchased skus
|
|
152
|
+
*/
|
|
153
|
+
readonly latestExpirationDate: string | null;
|
|
154
|
+
/**
|
|
155
|
+
* The date this user was first seen in RevenueCat.
|
|
156
|
+
*/
|
|
157
|
+
readonly firstSeen: string;
|
|
158
|
+
/**
|
|
159
|
+
* The original App User Id recorded for this user.
|
|
160
|
+
*/
|
|
161
|
+
readonly originalAppUserId: string;
|
|
162
|
+
/**
|
|
163
|
+
* Date when this info was requested
|
|
164
|
+
*/
|
|
165
|
+
readonly requestDate: string;
|
|
166
|
+
/**
|
|
167
|
+
* Returns the version number for the version of the application when the
|
|
168
|
+
* user bought the app. Use this for grandfathering users when migrating
|
|
169
|
+
* to subscriptions.
|
|
170
|
+
*
|
|
171
|
+
* This corresponds to the value of CFBundleVersion (in iOS) in the
|
|
172
|
+
* Info.plist file when the purchase was originally made. This is always null
|
|
173
|
+
* in Android
|
|
174
|
+
*/
|
|
175
|
+
readonly originalApplicationVersion: string | null;
|
|
176
|
+
/**
|
|
177
|
+
* Returns the purchase date for the version of the application when the user bought the app.
|
|
178
|
+
* Use this for grandfathering users when migrating to subscriptions.
|
|
179
|
+
*/
|
|
180
|
+
readonly originalPurchaseDate: string | null;
|
|
181
|
+
/**
|
|
182
|
+
* URL to manage the active subscription of the user. If this user has an active iOS
|
|
183
|
+
* subscription, this will point to the App Store, if the user has an active Play Store subscription
|
|
184
|
+
* it will point there. If there are no active subscriptions it will be null.
|
|
185
|
+
* If there are multiple for different platforms, it will point to the device store.
|
|
186
|
+
*/
|
|
187
|
+
readonly managementURL: string | null;
|
|
188
|
+
}
|
|
189
|
+
export interface SubscriptionPeriod {
|
|
190
|
+
/**
|
|
191
|
+
* The Subscription Period number of unit.
|
|
192
|
+
*/
|
|
193
|
+
readonly numberOfUnits: number;
|
|
194
|
+
/**
|
|
195
|
+
* The Subscription Period unit.
|
|
196
|
+
*/
|
|
197
|
+
readonly unit: number;
|
|
198
|
+
}
|
|
199
|
+
export interface SKProductDiscount {
|
|
200
|
+
/**
|
|
201
|
+
* The Product discount identifier.
|
|
202
|
+
*/
|
|
203
|
+
readonly identifier: string;
|
|
204
|
+
/**
|
|
205
|
+
* The Product discount type.
|
|
206
|
+
*/
|
|
207
|
+
readonly type: number;
|
|
208
|
+
/**
|
|
209
|
+
* The Product discount price.
|
|
210
|
+
*/
|
|
211
|
+
readonly price: number;
|
|
212
|
+
/**
|
|
213
|
+
* Formatted price of the item, including its currency sign, such as €3.99.
|
|
214
|
+
*/
|
|
215
|
+
readonly priceString: string;
|
|
216
|
+
/**
|
|
217
|
+
* The Product discount currency symbol.
|
|
218
|
+
*/
|
|
219
|
+
readonly currencySymbol: string;
|
|
220
|
+
/**
|
|
221
|
+
* The Product discount currency code.
|
|
222
|
+
*/
|
|
223
|
+
readonly currencyCode: string;
|
|
224
|
+
/**
|
|
225
|
+
* The Product discount paymentMode.
|
|
226
|
+
*/
|
|
227
|
+
readonly paymentMode: number;
|
|
228
|
+
/**
|
|
229
|
+
* The Product discount number Of Periods.
|
|
230
|
+
*/
|
|
231
|
+
readonly numberOfPeriods: number;
|
|
232
|
+
/**
|
|
233
|
+
* The Product discount subscription period.
|
|
234
|
+
*/
|
|
235
|
+
readonly subscriptionPeriod: SubscriptionPeriod;
|
|
236
|
+
}
|
|
237
|
+
export interface Product {
|
|
238
|
+
/**
|
|
239
|
+
* Product Id.
|
|
240
|
+
*/
|
|
241
|
+
readonly identifier: string;
|
|
242
|
+
/**
|
|
243
|
+
* Description of the product.
|
|
244
|
+
*/
|
|
245
|
+
readonly description: string;
|
|
246
|
+
/**
|
|
247
|
+
* Title of the product.
|
|
248
|
+
*/
|
|
249
|
+
readonly title: string;
|
|
250
|
+
/**
|
|
251
|
+
* Price of the product in the local currency.
|
|
252
|
+
*/
|
|
253
|
+
readonly price: number;
|
|
254
|
+
/**
|
|
255
|
+
* Formatted price of the item, including its currency sign, such as €3.99.
|
|
256
|
+
*/
|
|
257
|
+
readonly priceString: string;
|
|
258
|
+
/**
|
|
259
|
+
* Currency code for price and original price.
|
|
260
|
+
*/
|
|
261
|
+
readonly currencyCode: string;
|
|
262
|
+
/**
|
|
263
|
+
* Currency symbol for price and original price.
|
|
264
|
+
*/
|
|
265
|
+
readonly currencySymbol: string;
|
|
266
|
+
/**
|
|
267
|
+
* Boolean indicating if the product is sharable with family
|
|
268
|
+
*/
|
|
269
|
+
readonly isFamilyShareable: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* Group identifier for the product.
|
|
272
|
+
*/
|
|
273
|
+
readonly subscriptionGroupIdentifier: string;
|
|
274
|
+
/**
|
|
275
|
+
* The Product subcription group identifier.
|
|
276
|
+
*/
|
|
277
|
+
readonly subscriptionPeriod: SubscriptionPeriod;
|
|
278
|
+
/**
|
|
279
|
+
* The Product introductory Price.
|
|
280
|
+
*/
|
|
281
|
+
readonly introductoryPrice: SKProductDiscount | null;
|
|
282
|
+
/**
|
|
283
|
+
* The Product discounts list.
|
|
284
|
+
*/
|
|
285
|
+
readonly discounts: SKProductDiscount[];
|
|
286
|
+
}
|
|
287
|
+
export interface NativePurchasesPlugin {
|
|
288
|
+
/**
|
|
289
|
+
* Restores a user's previous and links their appUserIDs to any user's also using those .
|
|
290
|
+
*/
|
|
291
|
+
restorePurchases(): Promise<{
|
|
292
|
+
customerInfo: CustomerInfo;
|
|
293
|
+
}>;
|
|
294
|
+
purchaseProduct(options: {
|
|
295
|
+
productIdentifier: string;
|
|
296
|
+
quantity: number;
|
|
297
|
+
}): Promise<{
|
|
298
|
+
customerInfo: CustomerInfo;
|
|
299
|
+
}>;
|
|
300
|
+
getProducts(options: {
|
|
301
|
+
productIdentifiers: string[];
|
|
302
|
+
}): Promise<{
|
|
303
|
+
products: Product[];
|
|
304
|
+
}>;
|
|
305
|
+
}
|