From 46b82114424137d8d1bbf982f05e3552092d76ec Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 15 Jun 2020 08:57:51 +0200 Subject: [PATCH] MOBILE-3401 iab: Fix override window.open in iOS --- src/providers/utils/utils.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/providers/utils/utils.ts b/src/providers/utils/utils.ts index b34965090..75a50620b 100644 --- a/src/providers/utils/utils.ts +++ b/src/providers/utils/utils.ts @@ -86,12 +86,14 @@ export class CoreUtilsProvider { protected qrScanner: QRScanner) { this.logger = logger.getInstance('CoreUtilsProvider'); - const win = window; + this.platform.ready().then(() => { + const win = window; - if (win.cordova && win.cordova.InAppBrowser) { - // Override the default window.open with the InAppBrowser one. - win.open = win.cordova.InAppBrowser.open; - } + if (win.cordova && win.cordova.InAppBrowser) { + // Override the default window.open with the InAppBrowser one. + win.open = win.cordova.InAppBrowser.open; + } + }); } /**