@capgo/native-purchases 0.0.26 → 0.0.29
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 +14 -0
- package/android/src/main/java/ee/forgr/nativepurchases/NativePurchasesPlugin.java +23 -7
- package/dist/docs.json +19 -0
- package/dist/esm/definitions.d.ts +9 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +3 -0
- package/dist/esm/web.js +4 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +4 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +4 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/NativePurchasesPlugin.m +1 -0
- package/ios/Plugin/NativePurchasesPlugin.swift +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,7 @@ Add this to manifest
|
|
|
30
30
|
* [`purchaseProduct(...)`](#purchaseproduct)
|
|
31
31
|
* [`getProducts(...)`](#getproducts)
|
|
32
32
|
* [`isBillingSupported()`](#isbillingsupported)
|
|
33
|
+
* [`getPluginVersion()`](#getpluginversion)
|
|
33
34
|
* [Interfaces](#interfaces)
|
|
34
35
|
* [Enums](#enums)
|
|
35
36
|
|
|
@@ -98,6 +99,19 @@ Check if billing is supported for the current device.
|
|
|
98
99
|
--------------------
|
|
99
100
|
|
|
100
101
|
|
|
102
|
+
### getPluginVersion()
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
getPluginVersion() => any
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Get the native Capacitor plugin version
|
|
109
|
+
|
|
110
|
+
**Returns:** <code>any</code>
|
|
111
|
+
|
|
112
|
+
--------------------
|
|
113
|
+
|
|
114
|
+
|
|
101
115
|
### Interfaces
|
|
102
116
|
|
|
103
117
|
|
|
@@ -31,7 +31,7 @@ import org.json.JSONException;
|
|
|
31
31
|
@CapacitorPlugin(name = "NativePurchases")
|
|
32
32
|
public class NativePurchasesPlugin extends Plugin {
|
|
33
33
|
|
|
34
|
-
public final String PLUGIN_VERSION = "
|
|
34
|
+
public final String PLUGIN_VERSION = "0.0.25";
|
|
35
35
|
private BillingClient billingClient;
|
|
36
36
|
|
|
37
37
|
private void isBillingSupported(PluginCall call) {
|
|
@@ -154,6 +154,17 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
@PluginMethod
|
|
158
|
+
public void getPluginVersion(final PluginCall call) {
|
|
159
|
+
try {
|
|
160
|
+
final JSObject ret = new JSObject();
|
|
161
|
+
ret.put("version", this.PLUGIN_VERSION);
|
|
162
|
+
call.resolve(ret);
|
|
163
|
+
} catch (final Exception e) {
|
|
164
|
+
call.reject("Could not get plugin version", e);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
157
168
|
@PluginMethod
|
|
158
169
|
public void purchaseProduct(PluginCall call) {
|
|
159
170
|
String productIdentifier = call.getString("productIdentifier");
|
|
@@ -172,9 +183,9 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
172
183
|
call.reject("productType is empty");
|
|
173
184
|
return;
|
|
174
185
|
}
|
|
175
|
-
if (planIdentifier.isEmpty()) {
|
|
176
|
-
// Handle error:
|
|
177
|
-
call.reject("productType is
|
|
186
|
+
if (productType.equals("subs") && planIdentifier.isEmpty()) {
|
|
187
|
+
// Handle error: no planIdentifier with productType subs
|
|
188
|
+
call.reject("planIdentifier cannot be empty if productType is subs");
|
|
178
189
|
return;
|
|
179
190
|
}
|
|
180
191
|
if (quantity.intValue() < 1) {
|
|
@@ -266,11 +277,16 @@ public class NativePurchasesPlugin extends Plugin {
|
|
|
266
277
|
public void getProducts(PluginCall call) {
|
|
267
278
|
JSONArray productIdentifiersArray = call.getArray("productIdentifiers");
|
|
268
279
|
String planIdentifier = call.getString("planIdentifier");
|
|
269
|
-
|
|
270
|
-
|
|
280
|
+
String productType = call.getString("productType", "inapp");
|
|
281
|
+
if (productType.equals("subs") && planIdentifier.isEmpty()) {
|
|
282
|
+
// Handle error: no planIdentifier with productType subs
|
|
283
|
+
call.reject("planIdentifier cannot be empty if productType is subs");
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (productIdentifiersArray == null || productIdentifiersArray.length() == 0) {
|
|
287
|
+
call.reject("productIdentifiers array missing");
|
|
271
288
|
return;
|
|
272
289
|
}
|
|
273
|
-
String productType = call.getString("productType", "inapp");
|
|
274
290
|
List<String> productIdentifiers = new ArrayList<>();
|
|
275
291
|
|
|
276
292
|
for (int i = 0; i < productIdentifiersArray.length(); i++) {
|
package/dist/docs.json
CHANGED
|
@@ -102,6 +102,25 @@
|
|
|
102
102
|
"docs": "Check if billing is supported for the current device.",
|
|
103
103
|
"complexTypes": [],
|
|
104
104
|
"slug": "isbillingsupported"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "getPluginVersion",
|
|
108
|
+
"signature": "() => any",
|
|
109
|
+
"parameters": [],
|
|
110
|
+
"returns": "any",
|
|
111
|
+
"tags": [
|
|
112
|
+
{
|
|
113
|
+
"name": "returns",
|
|
114
|
+
"text": "an Promise with version for this device"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"name": "throws",
|
|
118
|
+
"text": "An error if the something went wrong"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"docs": "Get the native Capacitor plugin version",
|
|
122
|
+
"complexTypes": [],
|
|
123
|
+
"slug": "getpluginversion"
|
|
105
124
|
}
|
|
106
125
|
],
|
|
107
126
|
"properties": []
|
|
@@ -320,4 +320,13 @@ export interface NativePurchasesPlugin {
|
|
|
320
320
|
isBillingSupported(): Promise<{
|
|
321
321
|
isBillingSupported: boolean;
|
|
322
322
|
}>;
|
|
323
|
+
/**
|
|
324
|
+
* Get the native Capacitor plugin version
|
|
325
|
+
*
|
|
326
|
+
* @returns {Promise<{ id: string }>} an Promise with version for this device
|
|
327
|
+
* @throws An error if the something went wrong
|
|
328
|
+
*/
|
|
329
|
+
getPluginVersion(): Promise<{
|
|
330
|
+
version: string;
|
|
331
|
+
}>;
|
|
323
332
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAmC,CAAA;IACnC;;OAEG;IACH,iIAAiC,CAAA;AACnC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["export enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = \"inapp\",\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = \"subs\",\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = \"UNKNOWN\",\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = \"CUSTOM\",\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = \"LIFETIME\",\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = \"ANNUAL\",\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = \"SIX_MONTH\",\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = \"THREE_MONTH\",\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = \"TWO_MONTH\",\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = \"MONTHLY\",\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = \"WEEKLY\",\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE,\n}\n\nexport interface Transaction {\n /**\n * RevenueCat Id associated to the transaction.\n */\n readonly transactionId: string;\n /**\n * Product Id associated with the transaction.\n */\n // readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n */\n // readonly purchaseDate: string;\n}\n\nexport interface CustomerInfo {\n /**\n * Set of active subscription skus\n */\n readonly activeSubscriptions: [string];\n /**\n * Set of purchased skus, active and inactive\n */\n readonly allPurchasedProductIdentifiers: [string];\n /**\n * Returns all the non-subscription a user has made.\n * The are ordered by purchase date in ascending order.\n */\n readonly nonSubscriptionTransactions: Transaction[];\n /**\n * The latest expiration date of all purchased skus\n */\n readonly latestExpirationDate: string | null;\n /**\n * The date this user was first seen in RevenueCat.\n */\n readonly firstSeen: string;\n /**\n * The original App User Id recorded for this user.\n */\n readonly originalAppUserId: string;\n /**\n * Date when this info was requested\n */\n readonly requestDate: string;\n /**\n * Returns the version number for the version of the application when the\n * user bought the app. Use this for grandfathering users when migrating\n * to subscriptions.\n *\n * This corresponds to the value of CFBundleVersion (in iOS) in the\n * Info.plist file when the purchase was originally made. This is always null\n * in Android\n */\n readonly originalApplicationVersion: string | null;\n /**\n * Returns the purchase date for the version of the application when the user bought the app.\n * Use this for grandfathering users when migrating to subscriptions.\n */\n readonly originalPurchaseDate: string | null;\n /**\n * URL to manage the active subscription of the user. If this user has an active iOS\n * subscription, this will point to the App Store, if the user has an active Play Store subscription\n * it will point there. If there are no active subscriptions it will be null.\n * If there are multiple for different platforms, it will point to the device store.\n */\n readonly managementURL: string | null;\n}\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n}\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\nexport interface Product {\n /**\n * Product Id.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * The Product subcription group identifier.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n /**\n * The Product introductory Price.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * The Product discounts list.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Started purchase process for the given product.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the plan you want to purchase.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: {\n productIdentifiers: string[];\n productType?: PURCHASE_TYPE;\n }): Promise<{ products: Product[] }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,qFAAoB,CAAA;IACpB,iEAAU,CAAA;IACV,uEAAa,CAAA;IACb,iEAAU,CAAA;IACV,iEAAU,CAAA;IACV,qEAAY,CAAA;AACd,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,CAAN,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB;;OAEG;IACH,gCAAe,CAAA;IAEf;;OAEG;IACH,8BAAa,CAAA;AACf,CAAC,EAVW,aAAa,KAAb,aAAa,QAUxB;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAyBX;AAzBD,WAAY,eAAe;IACzB;;OAEG;IACH,uEAAa,CAAA;IAEb;;OAEG;IACH,qFAAoB,CAAA;IAEpB;;OAEG;IACH,iFAAkB,CAAA;IAElB;;OAEG;IACH,mFAAmB,CAAA;IAEnB;;OAEG;IACH,+FAAyB,CAAA;AAC3B,CAAC,EAzBW,eAAe,KAAf,eAAe,QAyB1B;AACD,MAAM,CAAN,IAAY,cA2BX;AA3BD,WAAY,cAAc;IACxB,qIAAiD,CAAA;IAEjD;;;OAGG;IACH,qGAAiC,CAAA;IAEjC;;;;OAIG;IACH,iHAAuC,CAAA;IAEvC;;;OAGG;IACH,iGAA+B,CAAA;IAE/B;;;OAGG;IACH,2DAAY,CAAA;AACd,CAAC,EA3BW,cAAc,KAAd,cAAc,QA2BzB;AAED,MAAM,CAAN,IAAY,YA6CX;AA7CD,WAAY,YAAY;IACtB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,qCAAqB,CAAA;IAErB;;OAEG;IACH,iCAAiB,CAAA;IAEjB;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,2CAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAuB,CAAA;IAEvB;;OAEG;IACH,mCAAmB,CAAA;IAEnB;;OAEG;IACH,iCAAiB,CAAA;AACnB,CAAC,EA7CW,YAAY,KAAZ,YAAY,QA6CvB;AAED,MAAM,CAAN,IAAY,wBAaX;AAbD,WAAY,wBAAwB;IAClC;;OAEG;IACH,+HAAoC,CAAA;IACpC;;OAEG;IACH,qIAAmC,CAAA;IACnC;;OAEG;IACH,iIAAiC,CAAA;AACnC,CAAC,EAbW,wBAAwB,KAAxB,wBAAwB,QAanC","sourcesContent":["export enum ATTRIBUTION_NETWORK {\n APPLE_SEARCH_ADS = 0,\n ADJUST = 1,\n APPSFLYER = 2,\n BRANCH = 3,\n TENJIN = 4,\n FACEBOOK = 5,\n}\n\nexport enum PURCHASE_TYPE {\n /**\n * A type of SKU for in-app products.\n */\n INAPP = \"inapp\",\n\n /**\n * A type of SKU for subscriptions.\n */\n SUBS = \"subs\",\n}\n\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport enum BILLING_FEATURE {\n /**\n * Purchase/query for subscriptions.\n */\n SUBSCRIPTIONS,\n\n /**\n * Subscriptions update/replace.\n */\n SUBSCRIPTIONS_UPDATE,\n\n /**\n * Purchase/query for in-app items on VR.\n */\n IN_APP_ITEMS_ON_VR,\n\n /**\n * Purchase/query for subscriptions on VR.\n */\n SUBSCRIPTIONS_ON_VR,\n\n /**\n * Launch a price change confirmation flow.\n */\n PRICE_CHANGE_CONFIRMATION,\n}\nexport enum PRORATION_MODE {\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n IMMEDIATE_WITHOUT_PRORATION = 3,\n\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n DEFERRED = 4,\n}\n\nexport enum PACKAGE_TYPE {\n /**\n * A package that was defined with a custom identifier.\n */\n UNKNOWN = \"UNKNOWN\",\n\n /**\n * A package that was defined with a custom identifier.\n */\n CUSTOM = \"CUSTOM\",\n\n /**\n * A package configured with the predefined lifetime identifier.\n */\n LIFETIME = \"LIFETIME\",\n\n /**\n * A package configured with the predefined annual identifier.\n */\n ANNUAL = \"ANNUAL\",\n\n /**\n * A package configured with the predefined six month identifier.\n */\n SIX_MONTH = \"SIX_MONTH\",\n\n /**\n * A package configured with the predefined three month identifier.\n */\n THREE_MONTH = \"THREE_MONTH\",\n\n /**\n * A package configured with the predefined two month identifier.\n */\n TWO_MONTH = \"TWO_MONTH\",\n\n /**\n * A package configured with the predefined monthly identifier.\n */\n MONTHLY = \"MONTHLY\",\n\n /**\n * A package configured with the predefined weekly identifier.\n */\n WEEKLY = \"WEEKLY\",\n}\n\nexport enum INTRO_ELIGIBILITY_STATUS {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS_UNKNOWN = 0,\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_INELIGIBLE,\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS_ELIGIBLE,\n}\n\nexport interface Transaction {\n /**\n * RevenueCat Id associated to the transaction.\n */\n readonly transactionId: string;\n /**\n * Product Id associated with the transaction.\n */\n // readonly productIdentifier: string;\n /**\n * Purchase date of the transaction in ISO 8601 format.\n */\n // readonly purchaseDate: string;\n}\n\nexport interface CustomerInfo {\n /**\n * Set of active subscription skus\n */\n readonly activeSubscriptions: [string];\n /**\n * Set of purchased skus, active and inactive\n */\n readonly allPurchasedProductIdentifiers: [string];\n /**\n * Returns all the non-subscription a user has made.\n * The are ordered by purchase date in ascending order.\n */\n readonly nonSubscriptionTransactions: Transaction[];\n /**\n * The latest expiration date of all purchased skus\n */\n readonly latestExpirationDate: string | null;\n /**\n * The date this user was first seen in RevenueCat.\n */\n readonly firstSeen: string;\n /**\n * The original App User Id recorded for this user.\n */\n readonly originalAppUserId: string;\n /**\n * Date when this info was requested\n */\n readonly requestDate: string;\n /**\n * Returns the version number for the version of the application when the\n * user bought the app. Use this for grandfathering users when migrating\n * to subscriptions.\n *\n * This corresponds to the value of CFBundleVersion (in iOS) in the\n * Info.plist file when the purchase was originally made. This is always null\n * in Android\n */\n readonly originalApplicationVersion: string | null;\n /**\n * Returns the purchase date for the version of the application when the user bought the app.\n * Use this for grandfathering users when migrating to subscriptions.\n */\n readonly originalPurchaseDate: string | null;\n /**\n * URL to manage the active subscription of the user. If this user has an active iOS\n * subscription, this will point to the App Store, if the user has an active Play Store subscription\n * it will point there. If there are no active subscriptions it will be null.\n * If there are multiple for different platforms, it will point to the device store.\n */\n readonly managementURL: string | null;\n}\nexport interface SubscriptionPeriod {\n /**\n * The Subscription Period number of unit.\n */\n readonly numberOfUnits: number;\n /**\n * The Subscription Period unit.\n */\n readonly unit: number;\n}\nexport interface SKProductDiscount {\n /**\n * The Product discount identifier.\n */\n readonly identifier: string;\n /**\n * The Product discount type.\n */\n readonly type: number;\n /**\n * The Product discount price.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * The Product discount currency symbol.\n */\n readonly currencySymbol: string;\n /**\n * The Product discount currency code.\n */\n readonly currencyCode: string;\n /**\n * The Product discount paymentMode.\n */\n readonly paymentMode: number;\n /**\n * The Product discount number Of Periods.\n */\n readonly numberOfPeriods: number;\n /**\n * The Product discount subscription period.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n}\nexport interface Product {\n /**\n * Product Id.\n */\n readonly identifier: string;\n /**\n * Description of the product.\n */\n readonly description: string;\n /**\n * Title of the product.\n */\n readonly title: string;\n /**\n * Price of the product in the local currency.\n */\n readonly price: number;\n /**\n * Formatted price of the item, including its currency sign, such as €3.99.\n */\n readonly priceString: string;\n /**\n * Currency code for price and original price.\n */\n readonly currencyCode: string;\n /**\n * Currency symbol for price and original price.\n */\n readonly currencySymbol: string;\n /**\n * Boolean indicating if the product is sharable with family\n */\n readonly isFamilyShareable: boolean;\n /**\n * Group identifier for the product.\n */\n readonly subscriptionGroupIdentifier: string;\n /**\n * The Product subcription group identifier.\n */\n readonly subscriptionPeriod: SubscriptionPeriod;\n /**\n * The Product introductory Price.\n */\n readonly introductoryPrice: SKProductDiscount | null;\n /**\n * The Product discounts list.\n */\n readonly discounts: SKProductDiscount[];\n}\n\nexport interface NativePurchasesPlugin {\n /**\n * Restores a user's previous and links their appUserIDs to any user's also using those .\n */\n restorePurchases(): Promise<{ customerInfo: CustomerInfo }>;\n\n /**\n * Started purchase process for the given product.\n *\n * @param options - The product to purchase\n * @param options.productIdentifier - The product identifier of the product you want to purchase.\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @param options.planIdentifier - Only Android, the identifier of the plan you want to purchase.\n * @param options.quantity - Only iOS, the number of items you wish to purchase. Will use 1 by default.\n */\n purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier?: string;\n productType?: PURCHASE_TYPE;\n quantity?: number;\n }): Promise<Transaction>;\n\n /**\n * Gets the product info associated with a list of product identifiers.\n *\n * @param options - The product identifiers you wish to retrieve information for\n * @param options.productIdentifiers - Array of product identifiers\n * @param options.productType - Only Android, the type of product, can be inapp or subs. Will use inapp by default.\n * @returns - The requested product info\n */\n getProducts(options: {\n productIdentifiers: string[];\n productType?: PURCHASE_TYPE;\n }): Promise<{ products: Product[] }>;\n\n /**\n * Check if billing is supported for the current device.\n *\n *\n */\n isBillingSupported(): Promise<{ isBillingSupported: boolean }>;\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
package/dist/esm/web.js
CHANGED
|
@@ -28,5 +28,9 @@ export class NativePurchasesWeb extends WebPlugin {
|
|
|
28
28
|
console.error("isBillingSupported only mocked in web");
|
|
29
29
|
return { isBillingSupported: false };
|
|
30
30
|
}
|
|
31
|
+
async getPluginVersion() {
|
|
32
|
+
console.warn("Cannot get plugin version in web");
|
|
33
|
+
return { version: "default" };
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,mBAAmB,EAAE,CAAC,EAAE,CAAC;IACzB,8BAA8B,EAAE,CAAC,EAAE,CAAC;IACpC,2BAA2B,EAAE,EAAE;IAC/B,oBAAoB,EAAE,IAAI;IAC1B,SAAS,EAAE,0BAA0B;IACrC,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,0BAA0B;IACvC,0BAA0B,EAAE,EAAE;IAC9B,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAEjB;QACC,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAIrB;QACC,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;QAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n NativePurchasesPlugin,\n CustomerInfo,\n Product,\n} from \"./definitions\";\n\nexport const mockCustomerInfo: CustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\n\nexport class NativePurchasesWeb\n extends WebPlugin\n implements NativePurchasesPlugin\n{\n async restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n\n async getProducts(options: {\n productIdentifiers: string[];\n }): Promise<{ products: Product[] }> {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n\n async purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier: string;\n quantity: number;\n }): Promise<{ transactionId: string }> {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n\n async isBillingSupported(): Promise<{ isBillingSupported: boolean }> {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAQ5C,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,mBAAmB,EAAE,CAAC,EAAE,CAAC;IACzB,8BAA8B,EAAE,CAAC,EAAE,CAAC;IACpC,2BAA2B,EAAE,EAAE;IAC/B,oBAAoB,EAAE,IAAI;IAC1B,SAAS,EAAE,0BAA0B;IACrC,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,0BAA0B;IACvC,0BAA0B,EAAE,EAAE;IAC9B,oBAAoB,EAAE,IAAI;IAC1B,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,OAAO,kBACX,SAAQ,SAAS;IAGjB,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACpD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAEjB;QACC,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAIrB;QACC,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;QAC9D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,gBAAgB;QACpB,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["import { WebPlugin } from \"@capacitor/core\";\n\nimport type {\n NativePurchasesPlugin,\n CustomerInfo,\n Product,\n} from \"./definitions\";\n\nexport const mockCustomerInfo: CustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\n\nexport class NativePurchasesWeb\n extends WebPlugin\n implements NativePurchasesPlugin\n{\n async restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n\n async getProducts(options: {\n productIdentifiers: string[];\n }): Promise<{ products: Product[] }> {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n\n async purchaseProduct(options: {\n productIdentifier: string;\n planIdentifier: string;\n quantity: number;\n }): Promise<{ transactionId: string }> {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n\n async isBillingSupported(): Promise<{ isBillingSupported: boolean }> {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion(): Promise<{ version: string }> {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -154,6 +154,10 @@ class NativePurchasesWeb extends core.WebPlugin {
|
|
|
154
154
|
console.error("isBillingSupported only mocked in web");
|
|
155
155
|
return { isBillingSupported: false };
|
|
156
156
|
}
|
|
157
|
+
async getPluginVersion() {
|
|
158
|
+
console.warn("Cannot get plugin version in web");
|
|
159
|
+
return { version: "default" };
|
|
160
|
+
}
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;;;;AACA,CAAC,UAAU,mBAAmB,EAAE;AAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,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AAClC,IAAI,oBAAoB,EAAE,IAAI;AAC9B,IAAI,aAAa,EAAE,IAAI;AACvB,CAAC,CAAC;AACK,MAAM,kBAAkB,SAASC,cAAS,CAAC;AAClD,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC;AAC5D,QAAQ,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAClD,KAAK;AACL,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;AACnE,QAAQ,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAChC,KAAK;AACL,IAAI,MAAM,eAAe,CAAC,OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;AACtE,QAAQ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAClD,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC/D,QAAQ,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAC7C,KAAK;AACL;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;;;;AACA,CAAC,UAAU,mBAAmB,EAAE;AAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB,CAAC;AAC1F,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;AAC5E,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;AAC1E,CA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OAAO,EAAE;AACnC,QAAQ,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;AACtE,QAAQ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;AAClD,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;AAC/D,QAAQ,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;AAC7C,KAAK;AACL,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;AACzD,QAAQ,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACtC,KAAK;AACL;;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -151,6 +151,10 @@ var capacitorNativePurchases = (function (exports, core) {
|
|
|
151
151
|
console.error("isBillingSupported only mocked in web");
|
|
152
152
|
return { isBillingSupported: false };
|
|
153
153
|
}
|
|
154
|
+
async getPluginVersion() {
|
|
155
|
+
console.warn("Cannot get plugin version in web");
|
|
156
|
+
return { version: "default" };
|
|
157
|
+
}
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
var web = /*#__PURE__*/Object.freeze({
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK","PURCHASE_TYPE","BILLING_FEATURE","PRORATION_MODE","PACKAGE_TYPE","INTRO_ELIGIBILITY_STATUS","registerPlugin","WebPlugin"],"mappings":";;;IACA,CAAC,UAAU,mBAAmB,EAAE;IAChC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,kBAAkB,CAAC;IAC1F,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,CAAC;IAC5E,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACtE,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC;IAC1E,CAAC,EAAEA,2BAAmB,KAAKA,2BAAmB,GAAG,EAAE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AC,oCAAoC,GAAG,OAAO,CAAC,CAAC;IACtE,QAAQ,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,CAAC;IAClD,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC/D,QAAQ,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC;IAC7C,KAAK;IACL;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var ATTRIBUTION_NETWORK;\n(function (ATTRIBUTION_NETWORK) {\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPLE_SEARCH_ADS\"] = 0] = \"APPLE_SEARCH_ADS\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"ADJUST\"] = 1] = \"ADJUST\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"APPSFLYER\"] = 2] = \"APPSFLYER\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"BRANCH\"] = 3] = \"BRANCH\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"TENJIN\"] = 4] = \"TENJIN\";\n ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK[\"FACEBOOK\"] = 5] = \"FACEBOOK\";\n})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));\nexport var PURCHASE_TYPE;\n(function (PURCHASE_TYPE) {\n /**\n * A type of SKU for in-app products.\n */\n PURCHASE_TYPE[\"INAPP\"] = \"inapp\";\n /**\n * A type of SKU for subscriptions.\n */\n PURCHASE_TYPE[\"SUBS\"] = \"subs\";\n})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));\n/**\n * Enum for billing features.\n * Currently, these are only relevant for Google Play Android users:\n * https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType\n */\nexport var BILLING_FEATURE;\n(function (BILLING_FEATURE) {\n /**\n * Purchase/query for subscriptions.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS\"] = 0] = \"SUBSCRIPTIONS\";\n /**\n * Subscriptions update/replace.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_UPDATE\"] = 1] = \"SUBSCRIPTIONS_UPDATE\";\n /**\n * Purchase/query for in-app items on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"IN_APP_ITEMS_ON_VR\"] = 2] = \"IN_APP_ITEMS_ON_VR\";\n /**\n * Purchase/query for subscriptions on VR.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"SUBSCRIPTIONS_ON_VR\"] = 3] = \"SUBSCRIPTIONS_ON_VR\";\n /**\n * Launch a price change confirmation flow.\n */\n BILLING_FEATURE[BILLING_FEATURE[\"PRICE_CHANGE_CONFIRMATION\"] = 4] = \"PRICE_CHANGE_CONFIRMATION\";\n})(BILLING_FEATURE || (BILLING_FEATURE = {}));\nexport var PRORATION_MODE;\n(function (PRORATION_MODE) {\n PRORATION_MODE[PRORATION_MODE[\"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\"] = 0] = \"UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY\";\n /**\n * Replacement takes effect immediately, and the remaining time will be\n * prorated and credited to the user. This is the current default behavior.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITH_TIME_PRORATION\"] = 1] = \"IMMEDIATE_WITH_TIME_PRORATION\";\n /**\n * Replacement takes effect immediately, and the billing cycle remains the\n * same. The price for the remaining period will be charged. This option is\n * only available for subscription upgrade.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\"] = 2] = \"IMMEDIATE_AND_CHARGE_PRORATED_PRICE\";\n /**\n * Replacement takes effect immediately, and the new price will be charged on\n * next recurrence time. The billing cycle stays the same.\n */\n PRORATION_MODE[PRORATION_MODE[\"IMMEDIATE_WITHOUT_PRORATION\"] = 3] = \"IMMEDIATE_WITHOUT_PRORATION\";\n /**\n * Replacement takes effect when the old plan expires, and the new price will\n * be charged at the same time.\n */\n PRORATION_MODE[PRORATION_MODE[\"DEFERRED\"] = 4] = \"DEFERRED\";\n})(PRORATION_MODE || (PRORATION_MODE = {}));\nexport var PACKAGE_TYPE;\n(function (PACKAGE_TYPE) {\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"UNKNOWN\"] = \"UNKNOWN\";\n /**\n * A package that was defined with a custom identifier.\n */\n PACKAGE_TYPE[\"CUSTOM\"] = \"CUSTOM\";\n /**\n * A package configured with the predefined lifetime identifier.\n */\n PACKAGE_TYPE[\"LIFETIME\"] = \"LIFETIME\";\n /**\n * A package configured with the predefined annual identifier.\n */\n PACKAGE_TYPE[\"ANNUAL\"] = \"ANNUAL\";\n /**\n * A package configured with the predefined six month identifier.\n */\n PACKAGE_TYPE[\"SIX_MONTH\"] = \"SIX_MONTH\";\n /**\n * A package configured with the predefined three month identifier.\n */\n PACKAGE_TYPE[\"THREE_MONTH\"] = \"THREE_MONTH\";\n /**\n * A package configured with the predefined two month identifier.\n */\n PACKAGE_TYPE[\"TWO_MONTH\"] = \"TWO_MONTH\";\n /**\n * A package configured with the predefined monthly identifier.\n */\n PACKAGE_TYPE[\"MONTHLY\"] = \"MONTHLY\";\n /**\n * A package configured with the predefined weekly identifier.\n */\n PACKAGE_TYPE[\"WEEKLY\"] = \"WEEKLY\";\n})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));\nexport var INTRO_ELIGIBILITY_STATUS;\n(function (INTRO_ELIGIBILITY_STATUS) {\n /**\n * RevenueCat doesn't have enough information to determine eligibility.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_UNKNOWN\"] = 0] = \"INTRO_ELIGIBILITY_STATUS_UNKNOWN\";\n /**\n * The user is not eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\"] = 1] = \"INTRO_ELIGIBILITY_STATUS_INELIGIBLE\";\n /**\n * The user is eligible for a free trial or intro pricing for this product.\n */\n INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS[\"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\"] = 2] = \"INTRO_ELIGIBILITY_STATUS_ELIGIBLE\";\n})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from \"@capacitor/core\";\nconst NativePurchases = registerPlugin(\"NativePurchases\", {\n web: () => import(\"./web\").then((m) => new m.NativePurchasesWeb()),\n});\nexport * from \"./definitions\";\nexport { NativePurchases };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from \"@capacitor/core\";\nexport const mockCustomerInfo = {\n activeSubscriptions: [\"\"],\n allPurchasedProductIdentifiers: [\"\"],\n nonSubscriptionTransactions: [],\n latestExpirationDate: null,\n firstSeen: \"2020-01-01T00:00:00.000Z\",\n originalAppUserId: \"\",\n requestDate: \"2020-01-01T00:00:00.000Z\",\n originalApplicationVersion: \"\",\n originalPurchaseDate: null,\n managementURL: null,\n};\nexport class NativePurchasesWeb extends WebPlugin {\n async restorePurchases() {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n async getProducts(options) {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n async purchaseProduct(options) {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { transactionId: \"transactionId\" };\n }\n async isBillingSupported() {\n console.error(\"isBillingSupported only mocked in web\");\n return { isBillingSupported: false };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_NETWORK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NativePurchasesPlugin, "NativePurchases",
|
|
|
8
8
|
CAP_PLUGIN_METHOD(purchaseProduct, CAPPluginReturnPromise);
|
|
9
9
|
CAP_PLUGIN_METHOD(restorePurchases, CAPPluginReturnPromise);
|
|
10
10
|
CAP_PLUGIN_METHOD(isBillingSupported, CAPPluginReturnPromise);
|
|
11
|
+
CAP_PLUGIN_METHOD(getPluginVersion, CAPPluginReturnPromise);
|
|
11
12
|
)
|
|
@@ -9,7 +9,11 @@ import StoreKit
|
|
|
9
9
|
@objc(NativePurchasesPlugin)
|
|
10
10
|
public class NativePurchasesPlugin: CAPPlugin {
|
|
11
11
|
|
|
12
|
-
private let PLUGIN_VERSION = "
|
|
12
|
+
private let PLUGIN_VERSION = "0.0.25"
|
|
13
|
+
|
|
14
|
+
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
15
|
+
call.resolve(["version": self.PLUGIN_VERSION])
|
|
16
|
+
}
|
|
13
17
|
|
|
14
18
|
@objc func isBillingSupported(_ call: CAPPluginCall) {
|
|
15
19
|
if #available(iOS 15, *) {
|