capacitor-plugin-cdv-purchase 13.17.0 → 13.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/index.js +115 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/www/store.d.ts +2 -2
- package/www/store.js +115 -70
package/README.md
CHANGED
|
@@ -42,6 +42,18 @@ If you're using `cordova-plugin-purchase` in a Capacitor app:
|
|
|
42
42
|
3. `npx cap sync`
|
|
43
43
|
4. Update your import to `import { store, ProductType, Platform } from 'capacitor-plugin-cdv-purchase'` — the API is identical
|
|
44
44
|
|
|
45
|
+
## Device info for receipt validation
|
|
46
|
+
|
|
47
|
+
When validating receipts, the plugin sends device information (OS, model, manufacturer) to the validator to support fraud detection and support requests. In Capacitor apps, this information is collected automatically via `@capacitor/device` through the Capacitor plugin proxy — no additional plugin installation is required.
|
|
48
|
+
|
|
49
|
+
Customize what is sent with `store.validator_privacy_policy`:
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
store.validator_privacy_policy = ['fraud', 'support', 'analytics'];
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
See the [privacy policy documentation](https://github.com/j3k0/cordova-plugin-purchase/blob/master/api/classes/CdvPurchase.Store.md#validator_privacy_policy) for details.
|
|
56
|
+
|
|
45
57
|
## Platform Support
|
|
46
58
|
|
|
47
59
|
| Platform | Native API | Minimum OS |
|
package/dist/index.js
CHANGED
|
@@ -674,7 +674,7 @@ var CdvPurchase;
|
|
|
674
674
|
body.additionalData.obfuscatedUsername = obfuscated;
|
|
675
675
|
}
|
|
676
676
|
// Add device information
|
|
677
|
-
body.device = Object.assign(Object.assign({}, (_b = body.device) !== null && _b !== void 0 ? _b : {}), CdvPurchase.Validator.Internal.getDeviceInfo(this.controller));
|
|
677
|
+
body.device = Object.assign(Object.assign({}, (_b = body.device) !== null && _b !== void 0 ? _b : {}), yield CdvPurchase.Validator.Internal.getDeviceInfo(this.controller));
|
|
678
678
|
// Add legacy pricing information
|
|
679
679
|
if (((_c = body.offers) === null || _c === void 0 ? void 0 : _c.length) === 1) {
|
|
680
680
|
const offer = body.offers[0];
|
|
@@ -1704,7 +1704,7 @@ var CdvPurchase;
|
|
|
1704
1704
|
/**
|
|
1705
1705
|
* Current release number of the plugin.
|
|
1706
1706
|
*/
|
|
1707
|
-
CdvPurchase.PLUGIN_VERSION = '13.17.
|
|
1707
|
+
CdvPurchase.PLUGIN_VERSION = '13.17.2';
|
|
1708
1708
|
/**
|
|
1709
1709
|
* Entry class of the plugin.
|
|
1710
1710
|
*/
|
|
@@ -8941,78 +8941,123 @@ var CdvPurchase;
|
|
|
8941
8941
|
else // default: no tracking
|
|
8942
8942
|
return ['analytics', 'support', 'fraud'];
|
|
8943
8943
|
}
|
|
8944
|
+
/** Map @capacitor/device data to the cordova-plugin-device format.
|
|
8945
|
+
*
|
|
8946
|
+
* Used as a fallback when cordova-plugin-device isn't installed (typically
|
|
8947
|
+
* in Capacitor apps). Detected through the plugin proxy that Capacitor
|
|
8948
|
+
* registers at window.Capacitor.Plugins.Device, so the plugin doesn't
|
|
8949
|
+
* need a dependency on @capacitor/device.
|
|
8950
|
+
*
|
|
8951
|
+
* @param includeId fetch the device identifier (requires user consent) */
|
|
8952
|
+
function getCapacitorDevice(includeId) {
|
|
8953
|
+
var _a, _b, _c;
|
|
8954
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8955
|
+
const capacitorDevice = (_b = (_a = window.Capacitor) === null || _a === void 0 ? void 0 : _a.Plugins) === null || _b === void 0 ? void 0 : _b.Device;
|
|
8956
|
+
if (!capacitorDevice)
|
|
8957
|
+
return {};
|
|
8958
|
+
const device = {};
|
|
8959
|
+
try {
|
|
8960
|
+
const info = yield capacitorDevice.getInfo();
|
|
8961
|
+
if (isObject(info)) {
|
|
8962
|
+
device.model = info.model;
|
|
8963
|
+
// match cordova-plugin-device casing ("iOS", "Android")
|
|
8964
|
+
device.platform = info.operatingSystem === 'ios' ? 'iOS'
|
|
8965
|
+
: info.operatingSystem === 'android' ? 'Android'
|
|
8966
|
+
: info.operatingSystem;
|
|
8967
|
+
device.version = info.osVersion;
|
|
8968
|
+
device.manufacturer = info.manufacturer;
|
|
8969
|
+
device.isVirtual = info.isVirtual;
|
|
8970
|
+
}
|
|
8971
|
+
}
|
|
8972
|
+
catch (e) { /* @capacitor/device not functional, skip device info */ }
|
|
8973
|
+
if (includeId) {
|
|
8974
|
+
try {
|
|
8975
|
+
const id = yield capacitorDevice.getId();
|
|
8976
|
+
// "identifier" since @capacitor/device v4, "uuid" before
|
|
8977
|
+
device.uuid = (_c = id === null || id === void 0 ? void 0 : id.identifier) !== null && _c !== void 0 ? _c : id === null || id === void 0 ? void 0 : id.uuid;
|
|
8978
|
+
}
|
|
8979
|
+
catch (e) { /* ignore, "uuid" stays undefined */ }
|
|
8980
|
+
}
|
|
8981
|
+
return device;
|
|
8982
|
+
});
|
|
8983
|
+
}
|
|
8944
8984
|
function getDeviceInfo(store) {
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
//
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
8974
|
-
if (device.version)
|
|
8975
|
-
ret.version = device.version; // OS version
|
|
8976
|
-
if (device.manufacturer)
|
|
8977
|
-
ret.manufacturer = device.manufacturer; // Device manufacturer
|
|
8978
|
-
}
|
|
8979
|
-
// Device identifiers are used for tracking users across services
|
|
8980
|
-
// It is sometimes required for support requests too, but I choose to
|
|
8981
|
-
// keep this out.
|
|
8982
|
-
if (allowed('tracking')) {
|
|
8983
|
-
if (device.serial)
|
|
8984
|
-
ret.serial = device.serial; // Hardware serial number
|
|
8985
|
-
if (device.uuid)
|
|
8986
|
-
ret.uuid = device.uuid; // Device UUID
|
|
8987
|
-
}
|
|
8988
|
-
// Running from a simulator is an error condition for in-app purchases.
|
|
8989
|
-
// Since only developers run in a simulator, let's always report that.
|
|
8990
|
-
if (device.isVirtual)
|
|
8991
|
-
ret.isVirtual = device.isVirtual; // Simulator
|
|
8992
|
-
// Probably nobody wants to disable fraud discovery.
|
|
8993
|
-
// A fingerprint of the device identifiers is used for fraud discovery.
|
|
8994
|
-
// An alert should be triggered by the validator when a lot of devices
|
|
8995
|
-
// share a single receipt.
|
|
8996
|
-
if (allowed('fraud')) {
|
|
8997
|
-
// For fraud discovery, we only need a fingerprint of the device.
|
|
8998
|
-
var fingerprint = '';
|
|
8999
|
-
if (device.serial)
|
|
9000
|
-
fingerprint = 'serial:' + device.serial; // Hardware serial number
|
|
9001
|
-
else if (device.uuid)
|
|
9002
|
-
fingerprint = 'uuid:' + device.uuid; // Device UUID
|
|
9003
|
-
else {
|
|
9004
|
-
// Using only model and manufacturer, we might end-up with many
|
|
9005
|
-
// users sharing the same fingerprint, which is fine for fraud discovery.
|
|
8985
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8986
|
+
const privacyPolicy = getPrivacyPolicy(store); // string[]
|
|
8987
|
+
function allowed(policy) {
|
|
8988
|
+
return privacyPolicy.indexOf(policy) >= 0;
|
|
8989
|
+
}
|
|
8990
|
+
// Different versions of the plugin use different response fields.
|
|
8991
|
+
// Sending this information allows the validator to reply with only expected information.
|
|
8992
|
+
const ret = {
|
|
8993
|
+
plugin: 'cordova-plugin-purchase/' + CdvPurchase.PLUGIN_VERSION,
|
|
8994
|
+
};
|
|
8995
|
+
const wdw = window;
|
|
8996
|
+
// the cordova-plugin-device global object,
|
|
8997
|
+
// with @capacitor/device as a fallback
|
|
8998
|
+
const device = isObject(wdw.device)
|
|
8999
|
+
? wdw.device
|
|
9000
|
+
: yield getCapacitorDevice(allowed('tracking') || allowed('fraud'));
|
|
9001
|
+
// Send the receipt validator information about the device.
|
|
9002
|
+
// This will allow to make vendor or device specific fixes and detect class
|
|
9003
|
+
// of devices with issues.
|
|
9004
|
+
// Knowing running version of OS and libraries also required for handling
|
|
9005
|
+
// support requests.
|
|
9006
|
+
if (allowed('analytics') || allowed('support')) {
|
|
9007
|
+
// Version of ionic (if applicable)
|
|
9008
|
+
const ionic = wdw.Ionic || wdw.ionic;
|
|
9009
|
+
if (ionic && ionic.version)
|
|
9010
|
+
ret.ionic = ionic.version;
|
|
9011
|
+
// Information from the cordova-plugin-device (if installed)
|
|
9012
|
+
if (device.cordova)
|
|
9013
|
+
ret.cordova = device.cordova; // Version of cordova
|
|
9006
9014
|
if (device.model)
|
|
9007
|
-
|
|
9015
|
+
ret.model = device.model; // Device model
|
|
9016
|
+
if (device.platform)
|
|
9017
|
+
ret.platform = device.platform; // OS
|
|
9018
|
+
if (device.version)
|
|
9019
|
+
ret.version = device.version; // OS version
|
|
9008
9020
|
if (device.manufacturer)
|
|
9009
|
-
|
|
9021
|
+
ret.manufacturer = device.manufacturer; // Device manufacturer
|
|
9022
|
+
}
|
|
9023
|
+
// Device identifiers are used for tracking users across services
|
|
9024
|
+
// It is sometimes required for support requests too, but I choose to
|
|
9025
|
+
// keep this out.
|
|
9026
|
+
if (allowed('tracking')) {
|
|
9027
|
+
if (device.serial)
|
|
9028
|
+
ret.serial = device.serial; // Hardware serial number
|
|
9029
|
+
if (device.uuid)
|
|
9030
|
+
ret.uuid = device.uuid; // Device UUID
|
|
9031
|
+
}
|
|
9032
|
+
// Running from a simulator is an error condition for in-app purchases.
|
|
9033
|
+
// Since only developers run in a simulator, let's always report that.
|
|
9034
|
+
if (device.isVirtual)
|
|
9035
|
+
ret.isVirtual = device.isVirtual; // Simulator
|
|
9036
|
+
// Probably nobody wants to disable fraud discovery.
|
|
9037
|
+
// A fingerprint of the device identifiers is used for fraud discovery.
|
|
9038
|
+
// An alert should be triggered by the validator when a lot of devices
|
|
9039
|
+
// share a single receipt.
|
|
9040
|
+
if (allowed('fraud')) {
|
|
9041
|
+
// For fraud discovery, we only need a fingerprint of the device.
|
|
9042
|
+
var fingerprint = '';
|
|
9043
|
+
if (device.serial)
|
|
9044
|
+
fingerprint = 'serial:' + device.serial; // Hardware serial number
|
|
9045
|
+
else if (device.uuid)
|
|
9046
|
+
fingerprint = 'uuid:' + device.uuid; // Device UUID
|
|
9047
|
+
else {
|
|
9048
|
+
// Using only model and manufacturer, we might end-up with many
|
|
9049
|
+
// users sharing the same fingerprint, which is fine for fraud discovery.
|
|
9050
|
+
if (device.model)
|
|
9051
|
+
fingerprint += '/' + device.model;
|
|
9052
|
+
if (device.manufacturer)
|
|
9053
|
+
fingerprint += '/' + device.manufacturer;
|
|
9054
|
+
}
|
|
9055
|
+
// Fingerprint is hashed to keep required level of privacy.
|
|
9056
|
+
if (fingerprint)
|
|
9057
|
+
ret.fingerprint = CdvPurchase.Utils.md5(fingerprint);
|
|
9010
9058
|
}
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
ret.fingerprint = CdvPurchase.Utils.md5(fingerprint);
|
|
9014
|
-
}
|
|
9015
|
-
return ret;
|
|
9059
|
+
return ret;
|
|
9060
|
+
});
|
|
9016
9061
|
}
|
|
9017
9062
|
Internal.getDeviceInfo = getDeviceInfo;
|
|
9018
9063
|
})(Validator.Internal || (Validator.Internal = {}));
|
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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;"}
|
|
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 Log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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
package/www/store.d.ts
CHANGED
|
@@ -911,7 +911,7 @@ declare namespace CdvPurchase {
|
|
|
911
911
|
/**
|
|
912
912
|
* Current release number of the plugin.
|
|
913
913
|
*/
|
|
914
|
-
const PLUGIN_VERSION = "13.17.
|
|
914
|
+
const PLUGIN_VERSION = "13.17.2";
|
|
915
915
|
/**
|
|
916
916
|
* Entry class of the plugin.
|
|
917
917
|
*/
|
|
@@ -6242,7 +6242,7 @@ declare namespace CdvPurchase {
|
|
|
6242
6242
|
interface PrivacyPolicyProvider {
|
|
6243
6243
|
validator_privacy_policy: undefined | string | string[];
|
|
6244
6244
|
}
|
|
6245
|
-
function getDeviceInfo(store: PrivacyPolicyProvider): DeviceInfo
|
|
6245
|
+
function getDeviceInfo(store: PrivacyPolicyProvider): Promise<DeviceInfo>;
|
|
6246
6246
|
}
|
|
6247
6247
|
}
|
|
6248
6248
|
}
|
package/www/store.js
CHANGED
|
@@ -679,7 +679,7 @@ var CdvPurchase;
|
|
|
679
679
|
body.additionalData.obfuscatedUsername = obfuscated;
|
|
680
680
|
}
|
|
681
681
|
// Add device information
|
|
682
|
-
body.device = Object.assign(Object.assign({}, (_b = body.device) !== null && _b !== void 0 ? _b : {}), CdvPurchase.Validator.Internal.getDeviceInfo(this.controller));
|
|
682
|
+
body.device = Object.assign(Object.assign({}, (_b = body.device) !== null && _b !== void 0 ? _b : {}), yield CdvPurchase.Validator.Internal.getDeviceInfo(this.controller));
|
|
683
683
|
// Add legacy pricing information
|
|
684
684
|
if (((_c = body.offers) === null || _c === void 0 ? void 0 : _c.length) === 1) {
|
|
685
685
|
const offer = body.offers[0];
|
|
@@ -1722,7 +1722,7 @@ var CdvPurchase;
|
|
|
1722
1722
|
/**
|
|
1723
1723
|
* Current release number of the plugin.
|
|
1724
1724
|
*/
|
|
1725
|
-
CdvPurchase.PLUGIN_VERSION = '13.17.
|
|
1725
|
+
CdvPurchase.PLUGIN_VERSION = '13.17.2';
|
|
1726
1726
|
/**
|
|
1727
1727
|
* Entry class of the plugin.
|
|
1728
1728
|
*/
|
|
@@ -9174,78 +9174,123 @@ var CdvPurchase;
|
|
|
9174
9174
|
else // default: no tracking
|
|
9175
9175
|
return ['analytics', 'support', 'fraud'];
|
|
9176
9176
|
}
|
|
9177
|
+
/** Map @capacitor/device data to the cordova-plugin-device format.
|
|
9178
|
+
*
|
|
9179
|
+
* Used as a fallback when cordova-plugin-device isn't installed (typically
|
|
9180
|
+
* in Capacitor apps). Detected through the plugin proxy that Capacitor
|
|
9181
|
+
* registers at window.Capacitor.Plugins.Device, so the plugin doesn't
|
|
9182
|
+
* need a dependency on @capacitor/device.
|
|
9183
|
+
*
|
|
9184
|
+
* @param includeId fetch the device identifier (requires user consent) */
|
|
9185
|
+
function getCapacitorDevice(includeId) {
|
|
9186
|
+
var _a, _b, _c;
|
|
9187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9188
|
+
const capacitorDevice = (_b = (_a = window.Capacitor) === null || _a === void 0 ? void 0 : _a.Plugins) === null || _b === void 0 ? void 0 : _b.Device;
|
|
9189
|
+
if (!capacitorDevice)
|
|
9190
|
+
return {};
|
|
9191
|
+
const device = {};
|
|
9192
|
+
try {
|
|
9193
|
+
const info = yield capacitorDevice.getInfo();
|
|
9194
|
+
if (isObject(info)) {
|
|
9195
|
+
device.model = info.model;
|
|
9196
|
+
// match cordova-plugin-device casing ("iOS", "Android")
|
|
9197
|
+
device.platform = info.operatingSystem === 'ios' ? 'iOS'
|
|
9198
|
+
: info.operatingSystem === 'android' ? 'Android'
|
|
9199
|
+
: info.operatingSystem;
|
|
9200
|
+
device.version = info.osVersion;
|
|
9201
|
+
device.manufacturer = info.manufacturer;
|
|
9202
|
+
device.isVirtual = info.isVirtual;
|
|
9203
|
+
}
|
|
9204
|
+
}
|
|
9205
|
+
catch (e) { /* @capacitor/device not functional, skip device info */ }
|
|
9206
|
+
if (includeId) {
|
|
9207
|
+
try {
|
|
9208
|
+
const id = yield capacitorDevice.getId();
|
|
9209
|
+
// "identifier" since @capacitor/device v4, "uuid" before
|
|
9210
|
+
device.uuid = (_c = id === null || id === void 0 ? void 0 : id.identifier) !== null && _c !== void 0 ? _c : id === null || id === void 0 ? void 0 : id.uuid;
|
|
9211
|
+
}
|
|
9212
|
+
catch (e) { /* ignore, "uuid" stays undefined */ }
|
|
9213
|
+
}
|
|
9214
|
+
return device;
|
|
9215
|
+
});
|
|
9216
|
+
}
|
|
9177
9217
|
function getDeviceInfo(store) {
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
//
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
if (device.version)
|
|
9208
|
-
ret.version = device.version; // OS version
|
|
9209
|
-
if (device.manufacturer)
|
|
9210
|
-
ret.manufacturer = device.manufacturer; // Device manufacturer
|
|
9211
|
-
}
|
|
9212
|
-
// Device identifiers are used for tracking users across services
|
|
9213
|
-
// It is sometimes required for support requests too, but I choose to
|
|
9214
|
-
// keep this out.
|
|
9215
|
-
if (allowed('tracking')) {
|
|
9216
|
-
if (device.serial)
|
|
9217
|
-
ret.serial = device.serial; // Hardware serial number
|
|
9218
|
-
if (device.uuid)
|
|
9219
|
-
ret.uuid = device.uuid; // Device UUID
|
|
9220
|
-
}
|
|
9221
|
-
// Running from a simulator is an error condition for in-app purchases.
|
|
9222
|
-
// Since only developers run in a simulator, let's always report that.
|
|
9223
|
-
if (device.isVirtual)
|
|
9224
|
-
ret.isVirtual = device.isVirtual; // Simulator
|
|
9225
|
-
// Probably nobody wants to disable fraud discovery.
|
|
9226
|
-
// A fingerprint of the device identifiers is used for fraud discovery.
|
|
9227
|
-
// An alert should be triggered by the validator when a lot of devices
|
|
9228
|
-
// share a single receipt.
|
|
9229
|
-
if (allowed('fraud')) {
|
|
9230
|
-
// For fraud discovery, we only need a fingerprint of the device.
|
|
9231
|
-
var fingerprint = '';
|
|
9232
|
-
if (device.serial)
|
|
9233
|
-
fingerprint = 'serial:' + device.serial; // Hardware serial number
|
|
9234
|
-
else if (device.uuid)
|
|
9235
|
-
fingerprint = 'uuid:' + device.uuid; // Device UUID
|
|
9236
|
-
else {
|
|
9237
|
-
// Using only model and manufacturer, we might end-up with many
|
|
9238
|
-
// users sharing the same fingerprint, which is fine for fraud discovery.
|
|
9218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9219
|
+
const privacyPolicy = getPrivacyPolicy(store); // string[]
|
|
9220
|
+
function allowed(policy) {
|
|
9221
|
+
return privacyPolicy.indexOf(policy) >= 0;
|
|
9222
|
+
}
|
|
9223
|
+
// Different versions of the plugin use different response fields.
|
|
9224
|
+
// Sending this information allows the validator to reply with only expected information.
|
|
9225
|
+
const ret = {
|
|
9226
|
+
plugin: 'cordova-plugin-purchase/' + CdvPurchase.PLUGIN_VERSION,
|
|
9227
|
+
};
|
|
9228
|
+
const wdw = window;
|
|
9229
|
+
// the cordova-plugin-device global object,
|
|
9230
|
+
// with @capacitor/device as a fallback
|
|
9231
|
+
const device = isObject(wdw.device)
|
|
9232
|
+
? wdw.device
|
|
9233
|
+
: yield getCapacitorDevice(allowed('tracking') || allowed('fraud'));
|
|
9234
|
+
// Send the receipt validator information about the device.
|
|
9235
|
+
// This will allow to make vendor or device specific fixes and detect class
|
|
9236
|
+
// of devices with issues.
|
|
9237
|
+
// Knowing running version of OS and libraries also required for handling
|
|
9238
|
+
// support requests.
|
|
9239
|
+
if (allowed('analytics') || allowed('support')) {
|
|
9240
|
+
// Version of ionic (if applicable)
|
|
9241
|
+
const ionic = wdw.Ionic || wdw.ionic;
|
|
9242
|
+
if (ionic && ionic.version)
|
|
9243
|
+
ret.ionic = ionic.version;
|
|
9244
|
+
// Information from the cordova-plugin-device (if installed)
|
|
9245
|
+
if (device.cordova)
|
|
9246
|
+
ret.cordova = device.cordova; // Version of cordova
|
|
9239
9247
|
if (device.model)
|
|
9240
|
-
|
|
9248
|
+
ret.model = device.model; // Device model
|
|
9249
|
+
if (device.platform)
|
|
9250
|
+
ret.platform = device.platform; // OS
|
|
9251
|
+
if (device.version)
|
|
9252
|
+
ret.version = device.version; // OS version
|
|
9241
9253
|
if (device.manufacturer)
|
|
9242
|
-
|
|
9254
|
+
ret.manufacturer = device.manufacturer; // Device manufacturer
|
|
9255
|
+
}
|
|
9256
|
+
// Device identifiers are used for tracking users across services
|
|
9257
|
+
// It is sometimes required for support requests too, but I choose to
|
|
9258
|
+
// keep this out.
|
|
9259
|
+
if (allowed('tracking')) {
|
|
9260
|
+
if (device.serial)
|
|
9261
|
+
ret.serial = device.serial; // Hardware serial number
|
|
9262
|
+
if (device.uuid)
|
|
9263
|
+
ret.uuid = device.uuid; // Device UUID
|
|
9264
|
+
}
|
|
9265
|
+
// Running from a simulator is an error condition for in-app purchases.
|
|
9266
|
+
// Since only developers run in a simulator, let's always report that.
|
|
9267
|
+
if (device.isVirtual)
|
|
9268
|
+
ret.isVirtual = device.isVirtual; // Simulator
|
|
9269
|
+
// Probably nobody wants to disable fraud discovery.
|
|
9270
|
+
// A fingerprint of the device identifiers is used for fraud discovery.
|
|
9271
|
+
// An alert should be triggered by the validator when a lot of devices
|
|
9272
|
+
// share a single receipt.
|
|
9273
|
+
if (allowed('fraud')) {
|
|
9274
|
+
// For fraud discovery, we only need a fingerprint of the device.
|
|
9275
|
+
var fingerprint = '';
|
|
9276
|
+
if (device.serial)
|
|
9277
|
+
fingerprint = 'serial:' + device.serial; // Hardware serial number
|
|
9278
|
+
else if (device.uuid)
|
|
9279
|
+
fingerprint = 'uuid:' + device.uuid; // Device UUID
|
|
9280
|
+
else {
|
|
9281
|
+
// Using only model and manufacturer, we might end-up with many
|
|
9282
|
+
// users sharing the same fingerprint, which is fine for fraud discovery.
|
|
9283
|
+
if (device.model)
|
|
9284
|
+
fingerprint += '/' + device.model;
|
|
9285
|
+
if (device.manufacturer)
|
|
9286
|
+
fingerprint += '/' + device.manufacturer;
|
|
9287
|
+
}
|
|
9288
|
+
// Fingerprint is hashed to keep required level of privacy.
|
|
9289
|
+
if (fingerprint)
|
|
9290
|
+
ret.fingerprint = CdvPurchase.Utils.md5(fingerprint);
|
|
9243
9291
|
}
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
ret.fingerprint = CdvPurchase.Utils.md5(fingerprint);
|
|
9247
|
-
}
|
|
9248
|
-
return ret;
|
|
9292
|
+
return ret;
|
|
9293
|
+
});
|
|
9249
9294
|
}
|
|
9250
9295
|
Internal.getDeviceInfo = getDeviceInfo;
|
|
9251
9296
|
})(Internal = Validator.Internal || (Validator.Internal = {}));
|