Geschan opened a new issue #761:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/761


   # Bug Report
   
   ## Problem
   
   We're using In-App-Browser to open a payment gateway to recieve credit card 
and Apple Pay payments.
   To communicate between the app and the payment gateway we use 
`iab.executeScript();` and `webkit.messageHandlers.cordova_iab.postMessage()`
   
   **Our code:**
   ```
     showBrowser() {
       this.browser = this.iab.create(this.paymentGatewayUrl, '_blank', 
'location=no,usewkwebview=yes,hidenavigationbuttons=yes,toolbar=no');
       const iapSubscription = this.browser.on('loadstop').subscribe(() => {
         this.onInAppBrowserLoadstop();
         iapSubscription.unsubscribe();
       });
       this.browser.show();
     }
   
     sendMessage(type: string, message: string) {
       let code = 'var message = {type: \'' + type + '\', data: \'' + message + 
'\'};';
       code += 'handleMessage(message)';
       this.browser.executeScript({code: code});
     }
   ```
   
   The payment gateway does use `window.ApplePaySession` to check if Apple Pay 
is available and initiate payments.
   But it seems the usage of `executeScript()` does prevent Apple Pay from 
working. Before using executeScript the function 
`ApplePaySession.canMakePayments()` is set to true, after it's set to false.
   
   The other way arround, when executing `ApplePaySession.canMakePayments()` 
first, it seems `iab.executeScript();` is not working anymore.
   
   It's probably a security functionality, but we were not able to find any 
examples or documentation on this.
   
   ### Environment, Platform, Device
   Platform is iOS13 on iPhone 
   
   ### Version information
   Ionic:
   
      Ionic CLI          : 6.10.1 
(C:\Users\morit\AppData\Roaming\npm\node_modules\@ionic\cli)
      Ionic Framework    : ionic-angular 3.9.9
      @ionic/app-scripts : 3.2.4
   
   Cordova:
   
      Cordova CLI       : 9.0.0 ([email protected])
      Cordova Platforms : android 8.1.0
      Cordova Plugins   : cordova-plugin-inappbrowser 4.0.0, 
cordova-plugin-ionic 5.4.6, cordova-plugin-ionic-keyboard 2.2.0, 
cordova-plugin-ionic-webview 4.1.3, (and 14 other plugins)
   
   Utility:
   
      cordova-res (update available: 0.15.1) : 0.13.1
      native-run                             : 1.0.0
   
   System:
   
      NodeJS            : v12.16.2 (C:\Program Files\nodejs\node.exe)
      npm               : 6.14.7
   
   
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [ ] I updated all Cordova tooling to most recent version
      (updated in app browser plugin to latest version)
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to