cordova-plugin-purchase
Advanced tools
Comparing version 13.11.0 to 13.11.1
{ | ||
"name": "cordova-plugin-purchase", | ||
"version": "13.11.0", | ||
"version": "13.11.1", | ||
"description": "Cordova Purchase plugin for iOS, Android, Windows (AppStore, Play, UWP)", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -5,2 +5,10 @@ # Release Notes - Cordova Plugin Purchase | ||
### 13.11.1 | ||
#### Fix running from browser with Capacitor | ||
Add `Utils.platformId()` helper function to get rid of an error when running a Capacitor app in a browser. | ||
Ref issue #1566 | ||
### 13.11.0 | ||
@@ -7,0 +15,0 @@ |
declare interface Window { | ||
cordova: { | ||
/** Possible values: ios, android, etc. */ | ||
platformId: string; | ||
platformId?: string; | ||
plugin: { http?: any; } | ||
@@ -11,2 +12,6 @@ exec: (listener: ((msg?: any) => void) | undefined | null, errorCallback: ((err: string) => void) | undefined | null, context: string, fnName: string, args: any[]) => void; | ||
CdvPurchase: CdvPurchase; | ||
Capacitor?: { | ||
getPlatform(): 'ios' | 'android' | 'web'; | ||
} | ||
} |
@@ -159,3 +159,3 @@ /// <reference path="../../types.ts" /> | ||
get isSupported(): boolean { | ||
return window.cordova.platformId === 'ios'; | ||
return Utils.platformId() === 'ios'; | ||
} | ||
@@ -162,0 +162,0 @@ |
@@ -110,3 +110,3 @@ namespace CdvPurchase { | ||
static isSupported() { | ||
return window.cordova.platformId === 'android'; | ||
return Utils.platformId() === 'android'; | ||
} | ||
@@ -184,3 +184,3 @@ | ||
passKitCanMakePayments(callback: (value: boolean) => void, onFailure: Callback<string>) { | ||
switch (window.cordova.platformId) { | ||
switch (Utils.platformId()) { | ||
case 'android': | ||
@@ -187,0 +187,0 @@ return callback(true); // assuming we can always make payments on Android |
@@ -52,3 +52,3 @@ namespace CdvPurchase { | ||
return new Promise(resolve => { | ||
if (window.cordova.platformId !== 'ios') { | ||
if (Utils.platformId() !== 'ios') { | ||
log.info('BraintreeApplePayPlugin is only available for ios.'); | ||
@@ -55,0 +55,0 @@ return resolve(false); |
@@ -165,3 +165,3 @@ namespace CdvPurchase { | ||
static isSupported() { | ||
return window.cordova.platformId === 'ios'; | ||
return Utils.platformId() === 'ios'; | ||
} | ||
@@ -168,0 +168,0 @@ } |
@@ -127,3 +127,3 @@ /// <reference path="../../receipt.ts" /> | ||
get isSupported(): boolean { | ||
return window.cordova.platformId === 'android'; | ||
return Utils.platformId() === 'android'; | ||
} | ||
@@ -130,0 +130,0 @@ |
@@ -35,3 +35,3 @@ /// <reference path="types.ts" /> | ||
*/ | ||
export const PLUGIN_VERSION = '13.11.0'; | ||
export const PLUGIN_VERSION = '13.11.1'; | ||
@@ -680,3 +680,3 @@ /** | ||
defaultPlatform(): Platform { | ||
switch (window.cordova.platformId) { | ||
switch (Utils.platformId()) { | ||
case 'android': return Platform.GOOGLE_PLAY; | ||
@@ -683,0 +683,0 @@ case 'ios': return Platform.APPLE_APPSTORE; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1359466
95
24007