You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/14 15:46:35 UTC

[GitHub] [cordova-plugin-inappbrowser] Geschan opened a new issue #761: ApplePaySession not working in InAppBrowser

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 (cordova-lib@9.0.1)
      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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-plugin-inappbrowser] sjregan commented on issue #761: ApplePaySession not working in InAppBrowser

Posted by GitBox <gi...@apache.org>.
sjregan commented on issue #761:
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/761#issuecomment-829715054


   @Geschan Did you find a way around this? Thanks.


-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org