capacitor-plugin-cdv-purchase 13.16.0 → 13.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -1
- package/android/src/main/java/cc/fovea/iap/PurchasePlugin.java +34 -3
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -3
- package/www/store.d.ts +3 -1
- package/www/store.js +23 -3
package/android/build.gradle
CHANGED
|
@@ -36,7 +36,8 @@ repositories {
|
|
|
36
36
|
dependencies {
|
|
37
37
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
38
38
|
implementation project(':capacitor-android')
|
|
39
|
-
implementation 'com.android.billingclient:billing:
|
|
39
|
+
implementation 'com.android.billingclient:billing:9.0.0'
|
|
40
|
+
implementation 'androidx.core:core:1.9.0'
|
|
40
41
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
41
42
|
testImplementation "junit:junit:$junitVersion"
|
|
42
43
|
}
|
|
@@ -91,6 +91,14 @@ public class PurchasePlugin extends Plugin implements
|
|
|
91
91
|
/** Value for mBillingClientResult until BillingClient is connected. */
|
|
92
92
|
private static final int BILLING_CLIENT_NOT_CONNECTED = -1;
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Error code for a blocked Play Store (OEM kids mode, parental controls,
|
|
96
|
+
* enterprise policies). Must stay in sync with the canonical definitions
|
|
97
|
+
* in src/android/cc/fovea/Constants.java (ERR_STORE_BLOCKED) and
|
|
98
|
+
* src/ts/error-codes.ts (STORE_BLOCKED), both ERROR_CODES_BASE + 33.
|
|
99
|
+
*/
|
|
100
|
+
private static final int ERR_STORE_BLOCKED = 6777033;
|
|
101
|
+
|
|
94
102
|
/** Last response from the billing client. */
|
|
95
103
|
private BillingResult mBillingClientResult = BillingResult.newBuilder()
|
|
96
104
|
.setResponseCode(BILLING_CLIENT_NOT_CONNECTED).build();
|
|
@@ -353,7 +361,7 @@ public class PurchasePlugin extends Plugin implements
|
|
|
353
361
|
private String codeToMessage(int code) {
|
|
354
362
|
switch (code) {
|
|
355
363
|
case BillingResponseCode.BILLING_UNAVAILABLE:
|
|
356
|
-
return "Billing
|
|
364
|
+
return "Billing is not available on this device";
|
|
357
365
|
case BillingResponseCode.DEVELOPER_ERROR:
|
|
358
366
|
return "Invalid arguments provided to the API";
|
|
359
367
|
case BillingResponseCode.ERROR:
|
|
@@ -390,6 +398,19 @@ public class PurchasePlugin extends Plugin implements
|
|
|
390
398
|
return codeToString(code) + ": " + message;
|
|
391
399
|
}
|
|
392
400
|
|
|
401
|
+
/**
|
|
402
|
+
* Check if a BillingResult indicates that the Play Store is blocked
|
|
403
|
+
* on this device (OEM kids mode, parental controls, enterprise policies).
|
|
404
|
+
*
|
|
405
|
+
* In GPBL V9, this condition was reclassified from ERROR to BILLING_UNAVAILABLE
|
|
406
|
+
* with a "Play Store is blocked" debug message.
|
|
407
|
+
*/
|
|
408
|
+
private boolean isPlayStoreBlocked(final BillingResult result) {
|
|
409
|
+
return result.getResponseCode() == BillingResponseCode.BILLING_UNAVAILABLE
|
|
410
|
+
&& result.getDebugMessage() != null
|
|
411
|
+
&& result.getDebugMessage().contains("Play Store is blocked");
|
|
412
|
+
}
|
|
413
|
+
|
|
393
414
|
// -------------------------------------------------------------------------
|
|
394
415
|
// BillingClient connection management
|
|
395
416
|
// -------------------------------------------------------------------------
|
|
@@ -514,7 +535,12 @@ public class PurchasePlugin extends Plugin implements
|
|
|
514
535
|
}
|
|
515
536
|
}, () -> {
|
|
516
537
|
Log.d(TAG, "init() -> Failure: " + format(getLastResult()));
|
|
517
|
-
|
|
538
|
+
if (isPlayStoreBlocked(getLastResult())) {
|
|
539
|
+
call.reject("Play Store is blocked on this device",
|
|
540
|
+
String.valueOf(ERR_STORE_BLOCKED));
|
|
541
|
+
} else {
|
|
542
|
+
call.reject("Setup failure. " + format(getLastResult()));
|
|
543
|
+
}
|
|
518
544
|
});
|
|
519
545
|
}
|
|
520
546
|
|
|
@@ -792,7 +818,12 @@ public class PurchasePlugin extends Plugin implements
|
|
|
792
818
|
Log.w(TAG, "onPurchasesUpdated() -> Failed: "
|
|
793
819
|
+ format(result));
|
|
794
820
|
if (mPendingBuyCall != null) {
|
|
795
|
-
|
|
821
|
+
if (isPlayStoreBlocked(result)) {
|
|
822
|
+
mPendingBuyCall.reject("Play Store is blocked on this device",
|
|
823
|
+
String.valueOf(ERR_STORE_BLOCKED));
|
|
824
|
+
} else {
|
|
825
|
+
mPendingBuyCall.reject(format(result), String.valueOf(code));
|
|
826
|
+
}
|
|
796
827
|
mPendingBuyCall = null;
|
|
797
828
|
}
|
|
798
829
|
}
|
package/dist/index.js
CHANGED
|
@@ -81,6 +81,8 @@ var CdvPurchase;
|
|
|
81
81
|
ErrorCode[ErrorCode["INVALID_SIGNATURE"] = ERROR_CODES_BASE + 31] = "INVALID_SIGNATURE";
|
|
82
82
|
/** Error: Parameters are missing in a payment discount. */
|
|
83
83
|
ErrorCode[ErrorCode["MISSING_OFFER_PARAMS"] = ERROR_CODES_BASE + 32] = "MISSING_OFFER_PARAMS";
|
|
84
|
+
/** Error: The store is blocked (e.g. Google Play blocking purchases). */
|
|
85
|
+
ErrorCode[ErrorCode["STORE_BLOCKED"] = ERROR_CODES_BASE + 33] = "STORE_BLOCKED";
|
|
84
86
|
/**
|
|
85
87
|
* Server code used when a subscription expired.
|
|
86
88
|
*
|
|
@@ -1702,7 +1704,7 @@ var CdvPurchase;
|
|
|
1702
1704
|
/**
|
|
1703
1705
|
* Current release number of the plugin.
|
|
1704
1706
|
*/
|
|
1705
|
-
CdvPurchase.PLUGIN_VERSION = '13.
|
|
1707
|
+
CdvPurchase.PLUGIN_VERSION = '13.17.0';
|
|
1706
1708
|
/**
|
|
1707
1709
|
* Entry class of the plugin.
|
|
1708
1710
|
*/
|
|
@@ -2861,9 +2863,11 @@ var CdvPurchase;
|
|
|
2861
2863
|
return true;
|
|
2862
2864
|
if (transaction.isConsumed)
|
|
2863
2865
|
return true;
|
|
2866
|
+
if (transaction.isPending)
|
|
2867
|
+
return false;
|
|
2864
2868
|
if (transaction.expirationDate)
|
|
2865
2869
|
return transaction.expirationDate.getTime() <= +new Date();
|
|
2866
|
-
return
|
|
2870
|
+
return false;
|
|
2867
2871
|
}
|
|
2868
2872
|
}
|
|
2869
2873
|
Internal.LocalReceipts = LocalReceipts;
|
|
@@ -6095,8 +6099,17 @@ var CdvPurchase;
|
|
|
6095
6099
|
}
|
|
6096
6100
|
resolve(undefined);
|
|
6097
6101
|
};
|
|
6098
|
-
const iabError = (err) => {
|
|
6102
|
+
const iabError = (err, code) => {
|
|
6099
6103
|
this.initialized = false;
|
|
6104
|
+
// `Number(code)` normalizes both Cordova (numeric) and Capacitor (string) error codes.
|
|
6105
|
+
if (Number(code) === CdvPurchase.ErrorCode.STORE_BLOCKED) {
|
|
6106
|
+
// The Play Store is blocked by OEM restrictions; it won't unblock,
|
|
6107
|
+
// so report the error and resolve without retrying.
|
|
6108
|
+
const error = playStoreError(CdvPurchase.ErrorCode.STORE_BLOCKED, "Init failed - " + err, null);
|
|
6109
|
+
this.context.error(error);
|
|
6110
|
+
resolve(error);
|
|
6111
|
+
return;
|
|
6112
|
+
}
|
|
6100
6113
|
this.context.error(playStoreError(CdvPurchase.ErrorCode.SETUP, "Init failed - " + err, null));
|
|
6101
6114
|
this.retry.retry(() => this.initialize());
|
|
6102
6115
|
};
|
|
@@ -6351,6 +6364,13 @@ var CdvPurchase;
|
|
|
6351
6364
|
const buySuccess = () => resolve(undefined);
|
|
6352
6365
|
const buyFailed = (message, code) => {
|
|
6353
6366
|
this.log.warn('Order failed: ' + JSON.stringify({ message, code }));
|
|
6367
|
+
// `Number(code)` normalizes both Cordova (numeric) and Capacitor (string) error codes.
|
|
6368
|
+
if (Number(code) === CdvPurchase.ErrorCode.STORE_BLOCKED) {
|
|
6369
|
+
// The Play Store is blocked by OEM restrictions; resolve with the
|
|
6370
|
+
// blocked-store error immediately.
|
|
6371
|
+
resolve(playStoreError(CdvPurchase.ErrorCode.STORE_BLOCKED, message, offer.productId));
|
|
6372
|
+
return;
|
|
6373
|
+
}
|
|
6354
6374
|
resolve(playStoreError(code !== null && code !== void 0 ? code : CdvPurchase.ErrorCode.UNKNOWN, message, offer.productId));
|
|
6355
6375
|
};
|
|
6356
6376
|
if (offer.productType === CdvPurchase.ProductType.PAID_SUBSCRIPTION) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"index.js","sources":["esm/index.js","../build/entry.mjs"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n// Set the marker so the shared store.js knows Capacitor native bridges are available\nif (typeof window !== 'undefined') {\n window.CdvPurchaseCapacitor = { installed: true };\n}\nconst PurchasePlugin = registerPlugin('PurchasePlugin');\nexport { PurchasePlugin };\n","// Capacitor bridge — sets CdvPurchaseCapacitor marker and registers native plugin\nexport { PurchasePlugin } from '../dist/esm/index.js';\n\n// Store runtime — executes the IIFE, creates window.CdvPurchase\nimport { CdvPurchase } from 'virtual:store-js';\n\n// Re-export the full namespace\nexport { CdvPurchase };\n\n// Convenience named exports\nexport const store = CdvPurchase.store;\nexport const Store = CdvPurchase.Store;\nexport const ProductType = CdvPurchase.ProductType;\nexport const Platform = CdvPurchase.Platform;\nexport const LogLevel = CdvPurchase.LogLevel;\nexport const ErrorCode = CdvPurchase.ErrorCode;\nexport const Logger = CdvPurchase.Logger;\nexport const Iaptic = CdvPurchase.Iaptic;\n"],"names":[],"mappings":";;AACA;AACA,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACnC,IAAI,MAAM,CAAC,oBAAoB,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE;AACrD;AACK,MAAC,cAAc,GAAG,cAAc,CAAC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLtD;;AASA;AACY,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,KAAK,GAAG,WAAW,CAAC;AACrB,MAAC,WAAW,GAAG,WAAW,CAAC;AAC3B,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,QAAQ,GAAG,WAAW,CAAC;AACxB,MAAC,SAAS,GAAG,WAAW,CAAC;AACzB,MAAC,MAAM,GAAG,WAAW,CAAC;AACtB,MAAC,MAAM,GAAG,WAAW,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-plugin-cdv-purchase",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.17.0",
|
|
4
4
|
"description": "In-App Purchases for Capacitor — iOS (StoreKit 2) and Android (Google Play Billing)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
"./package.json": "./package.json"
|
|
15
15
|
},
|
|
16
16
|
"capacitor": {
|
|
17
|
-
"ios": {
|
|
18
|
-
|
|
17
|
+
"ios": {
|
|
18
|
+
"src": "ios"
|
|
19
|
+
},
|
|
20
|
+
"android": {
|
|
21
|
+
"src": "android"
|
|
22
|
+
}
|
|
19
23
|
},
|
|
20
24
|
"peerDependencies": {
|
|
21
25
|
"@capacitor/core": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
package/www/store.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ declare namespace CdvPurchase {
|
|
|
66
66
|
INVALID_SIGNATURE,
|
|
67
67
|
/** Error: Parameters are missing in a payment discount. */
|
|
68
68
|
MISSING_OFFER_PARAMS,
|
|
69
|
+
/** Error: The store is blocked (e.g. Google Play blocking purchases). */
|
|
70
|
+
STORE_BLOCKED,
|
|
69
71
|
/**
|
|
70
72
|
* Server code used when a subscription expired.
|
|
71
73
|
*
|
|
@@ -909,7 +911,7 @@ declare namespace CdvPurchase {
|
|
|
909
911
|
/**
|
|
910
912
|
* Current release number of the plugin.
|
|
911
913
|
*/
|
|
912
|
-
const PLUGIN_VERSION = "13.
|
|
914
|
+
const PLUGIN_VERSION = "13.17.0";
|
|
913
915
|
/**
|
|
914
916
|
* Entry class of the plugin.
|
|
915
917
|
*/
|
package/www/store.js
CHANGED
|
@@ -78,6 +78,8 @@ var CdvPurchase;
|
|
|
78
78
|
ErrorCode[ErrorCode["INVALID_SIGNATURE"] = ERROR_CODES_BASE + 31] = "INVALID_SIGNATURE";
|
|
79
79
|
/** Error: Parameters are missing in a payment discount. */
|
|
80
80
|
ErrorCode[ErrorCode["MISSING_OFFER_PARAMS"] = ERROR_CODES_BASE + 32] = "MISSING_OFFER_PARAMS";
|
|
81
|
+
/** Error: The store is blocked (e.g. Google Play blocking purchases). */
|
|
82
|
+
ErrorCode[ErrorCode["STORE_BLOCKED"] = ERROR_CODES_BASE + 33] = "STORE_BLOCKED";
|
|
81
83
|
/**
|
|
82
84
|
* Server code used when a subscription expired.
|
|
83
85
|
*
|
|
@@ -1720,7 +1722,7 @@ var CdvPurchase;
|
|
|
1720
1722
|
/**
|
|
1721
1723
|
* Current release number of the plugin.
|
|
1722
1724
|
*/
|
|
1723
|
-
CdvPurchase.PLUGIN_VERSION = '13.
|
|
1725
|
+
CdvPurchase.PLUGIN_VERSION = '13.17.0';
|
|
1724
1726
|
/**
|
|
1725
1727
|
* Entry class of the plugin.
|
|
1726
1728
|
*/
|
|
@@ -2915,9 +2917,11 @@ var CdvPurchase;
|
|
|
2915
2917
|
return true;
|
|
2916
2918
|
if (transaction.isConsumed)
|
|
2917
2919
|
return true;
|
|
2920
|
+
if (transaction.isPending)
|
|
2921
|
+
return false;
|
|
2918
2922
|
if (transaction.expirationDate)
|
|
2919
2923
|
return transaction.expirationDate.getTime() <= +new Date();
|
|
2920
|
-
return
|
|
2924
|
+
return false;
|
|
2921
2925
|
}
|
|
2922
2926
|
}
|
|
2923
2927
|
Internal.LocalReceipts = LocalReceipts;
|
|
@@ -6237,8 +6241,17 @@ var CdvPurchase;
|
|
|
6237
6241
|
}
|
|
6238
6242
|
resolve(undefined);
|
|
6239
6243
|
};
|
|
6240
|
-
const iabError = (err) => {
|
|
6244
|
+
const iabError = (err, code) => {
|
|
6241
6245
|
this.initialized = false;
|
|
6246
|
+
// `Number(code)` normalizes both Cordova (numeric) and Capacitor (string) error codes.
|
|
6247
|
+
if (Number(code) === CdvPurchase.ErrorCode.STORE_BLOCKED) {
|
|
6248
|
+
// The Play Store is blocked by OEM restrictions; it won't unblock,
|
|
6249
|
+
// so report the error and resolve without retrying.
|
|
6250
|
+
const error = playStoreError(CdvPurchase.ErrorCode.STORE_BLOCKED, "Init failed - " + err, null);
|
|
6251
|
+
this.context.error(error);
|
|
6252
|
+
resolve(error);
|
|
6253
|
+
return;
|
|
6254
|
+
}
|
|
6242
6255
|
this.context.error(playStoreError(CdvPurchase.ErrorCode.SETUP, "Init failed - " + err, null));
|
|
6243
6256
|
this.retry.retry(() => this.initialize());
|
|
6244
6257
|
};
|
|
@@ -6493,6 +6506,13 @@ var CdvPurchase;
|
|
|
6493
6506
|
const buySuccess = () => resolve(undefined);
|
|
6494
6507
|
const buyFailed = (message, code) => {
|
|
6495
6508
|
this.log.warn('Order failed: ' + JSON.stringify({ message, code }));
|
|
6509
|
+
// `Number(code)` normalizes both Cordova (numeric) and Capacitor (string) error codes.
|
|
6510
|
+
if (Number(code) === CdvPurchase.ErrorCode.STORE_BLOCKED) {
|
|
6511
|
+
// The Play Store is blocked by OEM restrictions; resolve with the
|
|
6512
|
+
// blocked-store error immediately.
|
|
6513
|
+
resolve(playStoreError(CdvPurchase.ErrorCode.STORE_BLOCKED, message, offer.productId));
|
|
6514
|
+
return;
|
|
6515
|
+
}
|
|
6496
6516
|
resolve(playStoreError(code !== null && code !== void 0 ? code : CdvPurchase.ErrorCode.UNKNOWN, message, offer.productId));
|
|
6497
6517
|
};
|
|
6498
6518
|
if (offer.productType === CdvPurchase.ProductType.PAID_SUBSCRIPTION) {
|