@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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export var ATTRIBUTION_NETWORK;
|
|
2
|
+
(function (ATTRIBUTION_NETWORK) {
|
|
3
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPLE_SEARCH_ADS"] = 0] = "APPLE_SEARCH_ADS";
|
|
4
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["ADJUST"] = 1] = "ADJUST";
|
|
5
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPSFLYER"] = 2] = "APPSFLYER";
|
|
6
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["BRANCH"] = 3] = "BRANCH";
|
|
7
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["TENJIN"] = 4] = "TENJIN";
|
|
8
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["FACEBOOK"] = 5] = "FACEBOOK";
|
|
9
|
+
})(ATTRIBUTION_NETWORK || (ATTRIBUTION_NETWORK = {}));
|
|
10
|
+
export var PURCHASE_TYPE;
|
|
11
|
+
(function (PURCHASE_TYPE) {
|
|
12
|
+
/**
|
|
13
|
+
* A type of SKU for in-app products.
|
|
14
|
+
*/
|
|
15
|
+
PURCHASE_TYPE["INAPP"] = "inapp";
|
|
16
|
+
/**
|
|
17
|
+
* A type of SKU for subscriptions.
|
|
18
|
+
*/
|
|
19
|
+
PURCHASE_TYPE["SUBS"] = "subs";
|
|
20
|
+
})(PURCHASE_TYPE || (PURCHASE_TYPE = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Enum for billing features.
|
|
23
|
+
* Currently, these are only relevant for Google Play Android users:
|
|
24
|
+
* https://developer.android.com/reference/com/android/billingclient/api/BillingClient.FeatureType
|
|
25
|
+
*/
|
|
26
|
+
export var BILLING_FEATURE;
|
|
27
|
+
(function (BILLING_FEATURE) {
|
|
28
|
+
/**
|
|
29
|
+
* Purchase/query for subscriptions.
|
|
30
|
+
*/
|
|
31
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS"] = 0] = "SUBSCRIPTIONS";
|
|
32
|
+
/**
|
|
33
|
+
* Subscriptions update/replace.
|
|
34
|
+
*/
|
|
35
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_UPDATE"] = 1] = "SUBSCRIPTIONS_UPDATE";
|
|
36
|
+
/**
|
|
37
|
+
* Purchase/query for in-app items on VR.
|
|
38
|
+
*/
|
|
39
|
+
BILLING_FEATURE[BILLING_FEATURE["IN_APP_ITEMS_ON_VR"] = 2] = "IN_APP_ITEMS_ON_VR";
|
|
40
|
+
/**
|
|
41
|
+
* Purchase/query for subscriptions on VR.
|
|
42
|
+
*/
|
|
43
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_ON_VR"] = 3] = "SUBSCRIPTIONS_ON_VR";
|
|
44
|
+
/**
|
|
45
|
+
* Launch a price change confirmation flow.
|
|
46
|
+
*/
|
|
47
|
+
BILLING_FEATURE[BILLING_FEATURE["PRICE_CHANGE_CONFIRMATION"] = 4] = "PRICE_CHANGE_CONFIRMATION";
|
|
48
|
+
})(BILLING_FEATURE || (BILLING_FEATURE = {}));
|
|
49
|
+
export var PRORATION_MODE;
|
|
50
|
+
(function (PRORATION_MODE) {
|
|
51
|
+
PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
|
|
52
|
+
/**
|
|
53
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
54
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
55
|
+
*/
|
|
56
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITH_TIME_PRORATION"] = 1] = "IMMEDIATE_WITH_TIME_PRORATION";
|
|
57
|
+
/**
|
|
58
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
59
|
+
* same. The price for the remaining period will be charged. This option is
|
|
60
|
+
* only available for subscription upgrade.
|
|
61
|
+
*/
|
|
62
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_PRORATED_PRICE"] = 2] = "IMMEDIATE_AND_CHARGE_PRORATED_PRICE";
|
|
63
|
+
/**
|
|
64
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
65
|
+
* next recurrence time. The billing cycle stays the same.
|
|
66
|
+
*/
|
|
67
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
|
|
68
|
+
/**
|
|
69
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
70
|
+
* be charged at the same time.
|
|
71
|
+
*/
|
|
72
|
+
PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
|
|
73
|
+
})(PRORATION_MODE || (PRORATION_MODE = {}));
|
|
74
|
+
export var PACKAGE_TYPE;
|
|
75
|
+
(function (PACKAGE_TYPE) {
|
|
76
|
+
/**
|
|
77
|
+
* A package that was defined with a custom identifier.
|
|
78
|
+
*/
|
|
79
|
+
PACKAGE_TYPE["UNKNOWN"] = "UNKNOWN";
|
|
80
|
+
/**
|
|
81
|
+
* A package that was defined with a custom identifier.
|
|
82
|
+
*/
|
|
83
|
+
PACKAGE_TYPE["CUSTOM"] = "CUSTOM";
|
|
84
|
+
/**
|
|
85
|
+
* A package configured with the predefined lifetime identifier.
|
|
86
|
+
*/
|
|
87
|
+
PACKAGE_TYPE["LIFETIME"] = "LIFETIME";
|
|
88
|
+
/**
|
|
89
|
+
* A package configured with the predefined annual identifier.
|
|
90
|
+
*/
|
|
91
|
+
PACKAGE_TYPE["ANNUAL"] = "ANNUAL";
|
|
92
|
+
/**
|
|
93
|
+
* A package configured with the predefined six month identifier.
|
|
94
|
+
*/
|
|
95
|
+
PACKAGE_TYPE["SIX_MONTH"] = "SIX_MONTH";
|
|
96
|
+
/**
|
|
97
|
+
* A package configured with the predefined three month identifier.
|
|
98
|
+
*/
|
|
99
|
+
PACKAGE_TYPE["THREE_MONTH"] = "THREE_MONTH";
|
|
100
|
+
/**
|
|
101
|
+
* A package configured with the predefined two month identifier.
|
|
102
|
+
*/
|
|
103
|
+
PACKAGE_TYPE["TWO_MONTH"] = "TWO_MONTH";
|
|
104
|
+
/**
|
|
105
|
+
* A package configured with the predefined monthly identifier.
|
|
106
|
+
*/
|
|
107
|
+
PACKAGE_TYPE["MONTHLY"] = "MONTHLY";
|
|
108
|
+
/**
|
|
109
|
+
* A package configured with the predefined weekly identifier.
|
|
110
|
+
*/
|
|
111
|
+
PACKAGE_TYPE["WEEKLY"] = "WEEKLY";
|
|
112
|
+
})(PACKAGE_TYPE || (PACKAGE_TYPE = {}));
|
|
113
|
+
export var INTRO_ELIGIBILITY_STATUS;
|
|
114
|
+
(function (INTRO_ELIGIBILITY_STATUS) {
|
|
115
|
+
/**
|
|
116
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
117
|
+
*/
|
|
118
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_UNKNOWN"] = 0] = "INTRO_ELIGIBILITY_STATUS_UNKNOWN";
|
|
119
|
+
/**
|
|
120
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
121
|
+
*/
|
|
122
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_INELIGIBLE"] = 1] = "INTRO_ELIGIBILITY_STATUS_INELIGIBLE";
|
|
123
|
+
/**
|
|
124
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
125
|
+
*/
|
|
126
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
|
|
127
|
+
})(INTRO_ELIGIBILITY_STATUS || (INTRO_ELIGIBILITY_STATUS = {}));
|
|
128
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +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;;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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 transactionIdentifier: 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 purchaseProduct(options: {productIdentifier: string, quantity: number}): Promise<{ customerInfo: CustomerInfo }>;\n\n getProducts(options: {productIdentifiers: string[]}): Promise<{ products: Product[] }>;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
const NativePurchases = registerPlugin('NativePurchases', {
|
|
3
|
+
web: () => import('./web').then(m => new m.NativePurchasesWeb()),
|
|
4
|
+
});
|
|
5
|
+
export * from './definitions';
|
|
6
|
+
export { NativePurchases };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,eAAe,GAAG,cAAc,CAAwB,iBAAiB,EAAE;IAC/E,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,kBAAkB,EAAE,CAAC;CACjE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { NativePurchasesPlugin } from './definitions';\n\nconst NativePurchases = registerPlugin<NativePurchasesPlugin>('NativePurchases', {\n web: () => import('./web').then(m => new m.NativePurchasesWeb()),\n});\n\nexport * from './definitions';\nexport { NativePurchases };\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { NativePurchasesPlugin, CustomerInfo, Product } from './definitions';
|
|
3
|
+
export declare const mockCustomerInfo: CustomerInfo;
|
|
4
|
+
export declare class NativePurchasesWeb extends WebPlugin implements NativePurchasesPlugin {
|
|
5
|
+
restorePurchases(): Promise<{
|
|
6
|
+
customerInfo: CustomerInfo;
|
|
7
|
+
}>;
|
|
8
|
+
getProducts(options: {
|
|
9
|
+
productIdentifiers: string[];
|
|
10
|
+
}): Promise<{
|
|
11
|
+
products: Product[];
|
|
12
|
+
}>;
|
|
13
|
+
purchaseProduct(options: {
|
|
14
|
+
productIdentifier: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
customerInfo: CustomerInfo;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
package/dist/esm/web.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
export const mockCustomerInfo = {
|
|
3
|
+
activeSubscriptions: [""],
|
|
4
|
+
allPurchasedProductIdentifiers: [""],
|
|
5
|
+
nonSubscriptionTransactions: [],
|
|
6
|
+
latestExpirationDate: null,
|
|
7
|
+
firstSeen: "2020-01-01T00:00:00.000Z",
|
|
8
|
+
originalAppUserId: "",
|
|
9
|
+
requestDate: "2020-01-01T00:00:00.000Z",
|
|
10
|
+
originalApplicationVersion: "",
|
|
11
|
+
originalPurchaseDate: null,
|
|
12
|
+
managementURL: null,
|
|
13
|
+
};
|
|
14
|
+
export class NativePurchasesWeb extends WebPlugin {
|
|
15
|
+
async restorePurchases() {
|
|
16
|
+
console.error("purchasePackage only mocked in web");
|
|
17
|
+
return { customerInfo: mockCustomerInfo };
|
|
18
|
+
}
|
|
19
|
+
async getProducts(options) {
|
|
20
|
+
console.error("getProducts only mocked in web " + options);
|
|
21
|
+
return { products: [] };
|
|
22
|
+
}
|
|
23
|
+
async purchaseProduct(options) {
|
|
24
|
+
console.error("purchaseProduct only mocked in web" + options);
|
|
25
|
+
return { customerInfo: mockCustomerInfo };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,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,kBAAmB,SAAQ,SAAS;IAC/C,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,OAA0C;QAC1D,OAAO,CAAC,KAAK,CAAC,iCAAiC,GAAG,OAAO,CAAC,CAAC;QAC3D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAAyD;QAC7E,OAAO,CAAC,KAAK,CAAC,oCAAoC,GAAG,OAAO,CAAC,CAAC;QAC9D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAC5C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { \n NativePurchasesPlugin,\n CustomerInfo,\n Product,\n} from './definitions';\n\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 extends WebPlugin implements NativePurchasesPlugin {\n async restorePurchases(): Promise<{ customerInfo: CustomerInfo }> {\n console.error(\"purchasePackage only mocked in web\");\n return { customerInfo: mockCustomerInfo };\n }\n\n async getProducts(options: { productIdentifiers: string[]; }): Promise<{ products: Product[]; }> {\n console.error(\"getProducts only mocked in web \" + options);\n return { products: [] };\n }\n\n async purchaseProduct(options: { productIdentifier: string; quantity: number; }): Promise<{ customerInfo: CustomerInfo; }> {\n console.error(\"purchaseProduct only mocked in web\" + options);\n return { customerInfo: mockCustomerInfo };\n }\n}\n"]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('@capacitor/core');
|
|
6
|
+
|
|
7
|
+
(function (ATTRIBUTION_NETWORK) {
|
|
8
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPLE_SEARCH_ADS"] = 0] = "APPLE_SEARCH_ADS";
|
|
9
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["ADJUST"] = 1] = "ADJUST";
|
|
10
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPSFLYER"] = 2] = "APPSFLYER";
|
|
11
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["BRANCH"] = 3] = "BRANCH";
|
|
12
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["TENJIN"] = 4] = "TENJIN";
|
|
13
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["FACEBOOK"] = 5] = "FACEBOOK";
|
|
14
|
+
})(exports.ATTRIBUTION_NETWORK || (exports.ATTRIBUTION_NETWORK = {}));
|
|
15
|
+
(function (PURCHASE_TYPE) {
|
|
16
|
+
/**
|
|
17
|
+
* A type of SKU for in-app products.
|
|
18
|
+
*/
|
|
19
|
+
PURCHASE_TYPE["INAPP"] = "inapp";
|
|
20
|
+
/**
|
|
21
|
+
* A type of SKU for subscriptions.
|
|
22
|
+
*/
|
|
23
|
+
PURCHASE_TYPE["SUBS"] = "subs";
|
|
24
|
+
})(exports.PURCHASE_TYPE || (exports.PURCHASE_TYPE = {}));
|
|
25
|
+
(function (BILLING_FEATURE) {
|
|
26
|
+
/**
|
|
27
|
+
* Purchase/query for subscriptions.
|
|
28
|
+
*/
|
|
29
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS"] = 0] = "SUBSCRIPTIONS";
|
|
30
|
+
/**
|
|
31
|
+
* Subscriptions update/replace.
|
|
32
|
+
*/
|
|
33
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_UPDATE"] = 1] = "SUBSCRIPTIONS_UPDATE";
|
|
34
|
+
/**
|
|
35
|
+
* Purchase/query for in-app items on VR.
|
|
36
|
+
*/
|
|
37
|
+
BILLING_FEATURE[BILLING_FEATURE["IN_APP_ITEMS_ON_VR"] = 2] = "IN_APP_ITEMS_ON_VR";
|
|
38
|
+
/**
|
|
39
|
+
* Purchase/query for subscriptions on VR.
|
|
40
|
+
*/
|
|
41
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_ON_VR"] = 3] = "SUBSCRIPTIONS_ON_VR";
|
|
42
|
+
/**
|
|
43
|
+
* Launch a price change confirmation flow.
|
|
44
|
+
*/
|
|
45
|
+
BILLING_FEATURE[BILLING_FEATURE["PRICE_CHANGE_CONFIRMATION"] = 4] = "PRICE_CHANGE_CONFIRMATION";
|
|
46
|
+
})(exports.BILLING_FEATURE || (exports.BILLING_FEATURE = {}));
|
|
47
|
+
(function (PRORATION_MODE) {
|
|
48
|
+
PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
|
|
49
|
+
/**
|
|
50
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
51
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
52
|
+
*/
|
|
53
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITH_TIME_PRORATION"] = 1] = "IMMEDIATE_WITH_TIME_PRORATION";
|
|
54
|
+
/**
|
|
55
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
56
|
+
* same. The price for the remaining period will be charged. This option is
|
|
57
|
+
* only available for subscription upgrade.
|
|
58
|
+
*/
|
|
59
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_PRORATED_PRICE"] = 2] = "IMMEDIATE_AND_CHARGE_PRORATED_PRICE";
|
|
60
|
+
/**
|
|
61
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
62
|
+
* next recurrence time. The billing cycle stays the same.
|
|
63
|
+
*/
|
|
64
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
|
|
65
|
+
/**
|
|
66
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
67
|
+
* be charged at the same time.
|
|
68
|
+
*/
|
|
69
|
+
PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
|
|
70
|
+
})(exports.PRORATION_MODE || (exports.PRORATION_MODE = {}));
|
|
71
|
+
(function (PACKAGE_TYPE) {
|
|
72
|
+
/**
|
|
73
|
+
* A package that was defined with a custom identifier.
|
|
74
|
+
*/
|
|
75
|
+
PACKAGE_TYPE["UNKNOWN"] = "UNKNOWN";
|
|
76
|
+
/**
|
|
77
|
+
* A package that was defined with a custom identifier.
|
|
78
|
+
*/
|
|
79
|
+
PACKAGE_TYPE["CUSTOM"] = "CUSTOM";
|
|
80
|
+
/**
|
|
81
|
+
* A package configured with the predefined lifetime identifier.
|
|
82
|
+
*/
|
|
83
|
+
PACKAGE_TYPE["LIFETIME"] = "LIFETIME";
|
|
84
|
+
/**
|
|
85
|
+
* A package configured with the predefined annual identifier.
|
|
86
|
+
*/
|
|
87
|
+
PACKAGE_TYPE["ANNUAL"] = "ANNUAL";
|
|
88
|
+
/**
|
|
89
|
+
* A package configured with the predefined six month identifier.
|
|
90
|
+
*/
|
|
91
|
+
PACKAGE_TYPE["SIX_MONTH"] = "SIX_MONTH";
|
|
92
|
+
/**
|
|
93
|
+
* A package configured with the predefined three month identifier.
|
|
94
|
+
*/
|
|
95
|
+
PACKAGE_TYPE["THREE_MONTH"] = "THREE_MONTH";
|
|
96
|
+
/**
|
|
97
|
+
* A package configured with the predefined two month identifier.
|
|
98
|
+
*/
|
|
99
|
+
PACKAGE_TYPE["TWO_MONTH"] = "TWO_MONTH";
|
|
100
|
+
/**
|
|
101
|
+
* A package configured with the predefined monthly identifier.
|
|
102
|
+
*/
|
|
103
|
+
PACKAGE_TYPE["MONTHLY"] = "MONTHLY";
|
|
104
|
+
/**
|
|
105
|
+
* A package configured with the predefined weekly identifier.
|
|
106
|
+
*/
|
|
107
|
+
PACKAGE_TYPE["WEEKLY"] = "WEEKLY";
|
|
108
|
+
})(exports.PACKAGE_TYPE || (exports.PACKAGE_TYPE = {}));
|
|
109
|
+
(function (INTRO_ELIGIBILITY_STATUS) {
|
|
110
|
+
/**
|
|
111
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
112
|
+
*/
|
|
113
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_UNKNOWN"] = 0] = "INTRO_ELIGIBILITY_STATUS_UNKNOWN";
|
|
114
|
+
/**
|
|
115
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
116
|
+
*/
|
|
117
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_INELIGIBLE"] = 1] = "INTRO_ELIGIBILITY_STATUS_INELIGIBLE";
|
|
118
|
+
/**
|
|
119
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
120
|
+
*/
|
|
121
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
|
|
122
|
+
})(exports.INTRO_ELIGIBILITY_STATUS || (exports.INTRO_ELIGIBILITY_STATUS = {}));
|
|
123
|
+
|
|
124
|
+
const NativePurchases = core.registerPlugin('NativePurchases', {
|
|
125
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.NativePurchasesWeb()),
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const mockCustomerInfo = {
|
|
129
|
+
activeSubscriptions: [""],
|
|
130
|
+
allPurchasedProductIdentifiers: [""],
|
|
131
|
+
nonSubscriptionTransactions: [],
|
|
132
|
+
latestExpirationDate: null,
|
|
133
|
+
firstSeen: "2020-01-01T00:00:00.000Z",
|
|
134
|
+
originalAppUserId: "",
|
|
135
|
+
requestDate: "2020-01-01T00:00:00.000Z",
|
|
136
|
+
originalApplicationVersion: "",
|
|
137
|
+
originalPurchaseDate: null,
|
|
138
|
+
managementURL: null,
|
|
139
|
+
};
|
|
140
|
+
class NativePurchasesWeb extends core.WebPlugin {
|
|
141
|
+
async restorePurchases() {
|
|
142
|
+
console.error("purchasePackage only mocked in web");
|
|
143
|
+
return { customerInfo: mockCustomerInfo };
|
|
144
|
+
}
|
|
145
|
+
async getProducts(options) {
|
|
146
|
+
console.error("getProducts only mocked in web " + options);
|
|
147
|
+
return { products: [] };
|
|
148
|
+
}
|
|
149
|
+
async purchaseProduct(options) {
|
|
150
|
+
console.error("purchaseProduct only mocked in web" + options);
|
|
151
|
+
return { customerInfo: mockCustomerInfo };
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
156
|
+
__proto__: null,
|
|
157
|
+
mockCustomerInfo: mockCustomerInfo,
|
|
158
|
+
NativePurchasesWeb: NativePurchasesWeb
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
exports.NativePurchases = NativePurchases;
|
|
162
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +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 { customerInfo: mockCustomerInfo };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["ATTRIBUTION_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EAAE,CAAC;AACxC,IAAI,2BAA2B,EAAE,EAAE;AACnC,IAAI,oBAAoB,EAAE,IAAI;AAC9B,IAAI,SAAS,EAAE,0BAA0B;AACzC,IAAI,iBAAiB,EAAE,EAAE;AACzB,IAAI,WAAW,EAAE,0BAA0B;AAC3C,IAAI,0BAA0B,EAAE,EAAE;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,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAClD,KAAK;AACL;;;;;;;;;;"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
var capacitorNativePurchases = (function (exports, core) {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
(function (ATTRIBUTION_NETWORK) {
|
|
5
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPLE_SEARCH_ADS"] = 0] = "APPLE_SEARCH_ADS";
|
|
6
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["ADJUST"] = 1] = "ADJUST";
|
|
7
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["APPSFLYER"] = 2] = "APPSFLYER";
|
|
8
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["BRANCH"] = 3] = "BRANCH";
|
|
9
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["TENJIN"] = 4] = "TENJIN";
|
|
10
|
+
ATTRIBUTION_NETWORK[ATTRIBUTION_NETWORK["FACEBOOK"] = 5] = "FACEBOOK";
|
|
11
|
+
})(exports.ATTRIBUTION_NETWORK || (exports.ATTRIBUTION_NETWORK = {}));
|
|
12
|
+
(function (PURCHASE_TYPE) {
|
|
13
|
+
/**
|
|
14
|
+
* A type of SKU for in-app products.
|
|
15
|
+
*/
|
|
16
|
+
PURCHASE_TYPE["INAPP"] = "inapp";
|
|
17
|
+
/**
|
|
18
|
+
* A type of SKU for subscriptions.
|
|
19
|
+
*/
|
|
20
|
+
PURCHASE_TYPE["SUBS"] = "subs";
|
|
21
|
+
})(exports.PURCHASE_TYPE || (exports.PURCHASE_TYPE = {}));
|
|
22
|
+
(function (BILLING_FEATURE) {
|
|
23
|
+
/**
|
|
24
|
+
* Purchase/query for subscriptions.
|
|
25
|
+
*/
|
|
26
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS"] = 0] = "SUBSCRIPTIONS";
|
|
27
|
+
/**
|
|
28
|
+
* Subscriptions update/replace.
|
|
29
|
+
*/
|
|
30
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_UPDATE"] = 1] = "SUBSCRIPTIONS_UPDATE";
|
|
31
|
+
/**
|
|
32
|
+
* Purchase/query for in-app items on VR.
|
|
33
|
+
*/
|
|
34
|
+
BILLING_FEATURE[BILLING_FEATURE["IN_APP_ITEMS_ON_VR"] = 2] = "IN_APP_ITEMS_ON_VR";
|
|
35
|
+
/**
|
|
36
|
+
* Purchase/query for subscriptions on VR.
|
|
37
|
+
*/
|
|
38
|
+
BILLING_FEATURE[BILLING_FEATURE["SUBSCRIPTIONS_ON_VR"] = 3] = "SUBSCRIPTIONS_ON_VR";
|
|
39
|
+
/**
|
|
40
|
+
* Launch a price change confirmation flow.
|
|
41
|
+
*/
|
|
42
|
+
BILLING_FEATURE[BILLING_FEATURE["PRICE_CHANGE_CONFIRMATION"] = 4] = "PRICE_CHANGE_CONFIRMATION";
|
|
43
|
+
})(exports.BILLING_FEATURE || (exports.BILLING_FEATURE = {}));
|
|
44
|
+
(function (PRORATION_MODE) {
|
|
45
|
+
PRORATION_MODE[PRORATION_MODE["UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY"] = 0] = "UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY";
|
|
46
|
+
/**
|
|
47
|
+
* Replacement takes effect immediately, and the remaining time will be
|
|
48
|
+
* prorated and credited to the user. This is the current default behavior.
|
|
49
|
+
*/
|
|
50
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITH_TIME_PRORATION"] = 1] = "IMMEDIATE_WITH_TIME_PRORATION";
|
|
51
|
+
/**
|
|
52
|
+
* Replacement takes effect immediately, and the billing cycle remains the
|
|
53
|
+
* same. The price for the remaining period will be charged. This option is
|
|
54
|
+
* only available for subscription upgrade.
|
|
55
|
+
*/
|
|
56
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_AND_CHARGE_PRORATED_PRICE"] = 2] = "IMMEDIATE_AND_CHARGE_PRORATED_PRICE";
|
|
57
|
+
/**
|
|
58
|
+
* Replacement takes effect immediately, and the new price will be charged on
|
|
59
|
+
* next recurrence time. The billing cycle stays the same.
|
|
60
|
+
*/
|
|
61
|
+
PRORATION_MODE[PRORATION_MODE["IMMEDIATE_WITHOUT_PRORATION"] = 3] = "IMMEDIATE_WITHOUT_PRORATION";
|
|
62
|
+
/**
|
|
63
|
+
* Replacement takes effect when the old plan expires, and the new price will
|
|
64
|
+
* be charged at the same time.
|
|
65
|
+
*/
|
|
66
|
+
PRORATION_MODE[PRORATION_MODE["DEFERRED"] = 4] = "DEFERRED";
|
|
67
|
+
})(exports.PRORATION_MODE || (exports.PRORATION_MODE = {}));
|
|
68
|
+
(function (PACKAGE_TYPE) {
|
|
69
|
+
/**
|
|
70
|
+
* A package that was defined with a custom identifier.
|
|
71
|
+
*/
|
|
72
|
+
PACKAGE_TYPE["UNKNOWN"] = "UNKNOWN";
|
|
73
|
+
/**
|
|
74
|
+
* A package that was defined with a custom identifier.
|
|
75
|
+
*/
|
|
76
|
+
PACKAGE_TYPE["CUSTOM"] = "CUSTOM";
|
|
77
|
+
/**
|
|
78
|
+
* A package configured with the predefined lifetime identifier.
|
|
79
|
+
*/
|
|
80
|
+
PACKAGE_TYPE["LIFETIME"] = "LIFETIME";
|
|
81
|
+
/**
|
|
82
|
+
* A package configured with the predefined annual identifier.
|
|
83
|
+
*/
|
|
84
|
+
PACKAGE_TYPE["ANNUAL"] = "ANNUAL";
|
|
85
|
+
/**
|
|
86
|
+
* A package configured with the predefined six month identifier.
|
|
87
|
+
*/
|
|
88
|
+
PACKAGE_TYPE["SIX_MONTH"] = "SIX_MONTH";
|
|
89
|
+
/**
|
|
90
|
+
* A package configured with the predefined three month identifier.
|
|
91
|
+
*/
|
|
92
|
+
PACKAGE_TYPE["THREE_MONTH"] = "THREE_MONTH";
|
|
93
|
+
/**
|
|
94
|
+
* A package configured with the predefined two month identifier.
|
|
95
|
+
*/
|
|
96
|
+
PACKAGE_TYPE["TWO_MONTH"] = "TWO_MONTH";
|
|
97
|
+
/**
|
|
98
|
+
* A package configured with the predefined monthly identifier.
|
|
99
|
+
*/
|
|
100
|
+
PACKAGE_TYPE["MONTHLY"] = "MONTHLY";
|
|
101
|
+
/**
|
|
102
|
+
* A package configured with the predefined weekly identifier.
|
|
103
|
+
*/
|
|
104
|
+
PACKAGE_TYPE["WEEKLY"] = "WEEKLY";
|
|
105
|
+
})(exports.PACKAGE_TYPE || (exports.PACKAGE_TYPE = {}));
|
|
106
|
+
(function (INTRO_ELIGIBILITY_STATUS) {
|
|
107
|
+
/**
|
|
108
|
+
* RevenueCat doesn't have enough information to determine eligibility.
|
|
109
|
+
*/
|
|
110
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_UNKNOWN"] = 0] = "INTRO_ELIGIBILITY_STATUS_UNKNOWN";
|
|
111
|
+
/**
|
|
112
|
+
* The user is not eligible for a free trial or intro pricing for this product.
|
|
113
|
+
*/
|
|
114
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_INELIGIBLE"] = 1] = "INTRO_ELIGIBILITY_STATUS_INELIGIBLE";
|
|
115
|
+
/**
|
|
116
|
+
* The user is eligible for a free trial or intro pricing for this product.
|
|
117
|
+
*/
|
|
118
|
+
INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
|
|
119
|
+
})(exports.INTRO_ELIGIBILITY_STATUS || (exports.INTRO_ELIGIBILITY_STATUS = {}));
|
|
120
|
+
|
|
121
|
+
const NativePurchases = core.registerPlugin('NativePurchases', {
|
|
122
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.NativePurchasesWeb()),
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const mockCustomerInfo = {
|
|
126
|
+
activeSubscriptions: [""],
|
|
127
|
+
allPurchasedProductIdentifiers: [""],
|
|
128
|
+
nonSubscriptionTransactions: [],
|
|
129
|
+
latestExpirationDate: null,
|
|
130
|
+
firstSeen: "2020-01-01T00:00:00.000Z",
|
|
131
|
+
originalAppUserId: "",
|
|
132
|
+
requestDate: "2020-01-01T00:00:00.000Z",
|
|
133
|
+
originalApplicationVersion: "",
|
|
134
|
+
originalPurchaseDate: null,
|
|
135
|
+
managementURL: null,
|
|
136
|
+
};
|
|
137
|
+
class NativePurchasesWeb extends core.WebPlugin {
|
|
138
|
+
async restorePurchases() {
|
|
139
|
+
console.error("purchasePackage only mocked in web");
|
|
140
|
+
return { customerInfo: mockCustomerInfo };
|
|
141
|
+
}
|
|
142
|
+
async getProducts(options) {
|
|
143
|
+
console.error("getProducts only mocked in web " + options);
|
|
144
|
+
return { products: [] };
|
|
145
|
+
}
|
|
146
|
+
async purchaseProduct(options) {
|
|
147
|
+
console.error("purchaseProduct only mocked in web" + options);
|
|
148
|
+
return { customerInfo: mockCustomerInfo };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
153
|
+
__proto__: null,
|
|
154
|
+
mockCustomerInfo: mockCustomerInfo,
|
|
155
|
+
NativePurchasesWeb: NativePurchasesWeb
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
exports.NativePurchases = NativePurchases;
|
|
159
|
+
|
|
160
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
161
|
+
|
|
162
|
+
return exports;
|
|
163
|
+
|
|
164
|
+
}({}, capacitorExports));
|
|
165
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +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 { customerInfo: mockCustomerInfo };\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,CAAC,CAAC,CAAC;IAEtD,CAAC,UAAU,aAAa,EAAE;IAC1B;IACA;IACA;IACA,IAAI,aAAa,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACrC;IACA;IACA;IACA,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACnC,CAAC,EAA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+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
|
7
|
+
<key>CFBundleExecutable</key>
|
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
|
9
|
+
<key>CFBundleIdentifier</key>
|
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
|
12
|
+
<string>6.0</string>
|
|
13
|
+
<key>CFBundleName</key>
|
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
|
15
|
+
<key>CFBundlePackageType</key>
|
|
16
|
+
<string>FMWK</string>
|
|
17
|
+
<key>CFBundleShortVersionString</key>
|
|
18
|
+
<string>1.0</string>
|
|
19
|
+
<key>CFBundleVersion</key>
|
|
20
|
+
<string>$(CURRENT_PROJECT_VERSION)</string>
|
|
21
|
+
<key>NSPrincipalClass</key>
|
|
22
|
+
<string></string>
|
|
23
|
+
</dict>
|
|
24
|
+
</plist>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
//! Project version number for Plugin.
|
|
4
|
+
FOUNDATION_EXPORT double PluginVersionNumber;
|
|
5
|
+
|
|
6
|
+
//! Project version string for Plugin.
|
|
7
|
+
FOUNDATION_EXPORT const unsigned char PluginVersionString[];
|
|
8
|
+
|
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Plugin/PublicHeader.h>
|
|
10
|
+
|