Skip to content

A fork of cordova-plugin-inappbrowser which adds Braintree's PopupBridge functionality to support PayPal payments

License

Notifications You must be signed in to change notification settings

muneer-khan/cordova-plugin-inappbrowser-popup-bridge

 
 

Repository files navigation

cordova-plugin-inappbrowser-popup-bridge

This is a fork of cordova-plugin-inappbrowser which adds support for Braintree's PopupBridge libraries for Android and iOS to support PayPal payments within the context of the InappBrowser element of a Cordova-based app.

The purpose of PopupBridge is to allow Webviews to open emulated popup windows in a browser and send data back to the parent page in the Webview. This is essential for Web-based PayPal checkout flows which use the Braintree JS SDK which supports popup emulation via PopupBridge.

See the example app project which demonstrates usage of cordova-plugin-inappbrowser-popup-bridge.

iOS 16.4 and inspectable webviews:

As of iOS 16.4 Apple has decided that webviews should no longer be inspectable by default, which makes debugging a pain. So we have addressed this issue, by reversing the default to the inspectable=YES setting, in the 'inspectable' branch of this project. 'master' will continue for now to have the normal defaults.

To get inspectable webviews with this plugin use this branch: https://github.com/palainteractive/cordova-plugin-inappbrowser-popup-bridge#inspectable

Installation

cordova plugin add cordova-plugin-inappbrowser-popup-bridge

iOS:

  • PopupBridge requires WKWebView.
  • Therefore, this plugin depends on cordova-plugin-wkwebview-engine which adds WKWebView support to Cordova.
    • You need to add this manually: cordova plugin add cordova-plugin-wkwebview-engine
    • Or you can use the Ionic variant: cordova plugin add cordova-plugin-ionic-webview
  • This means the main Cordova app Webview will also use WKWebView on iOS 9+.

Supported platform versions

The following supported platform versions are based on the versions suppored by the Braintree PopupBridge libraries.

Android

  • Requires cordova-android@10+
  • Requires Gradle v7.1.1 or above
  • Supports Android 5.0 / API 21 and above
  • Since v5, requires the Cordova activity to run as singleTask
    • Add <preference name="AndroidLaunchMode" value="singleTask" /> to <platform name="android"> in config.xml

iOS

  • Requires cordova-ios@6+
  • Supports iOS 9.0+

iOS Quirks

Since the introduction of iPadOS 13, iPads try to adapt their content mode / user agent for the optimal browsing experience. This may result in iPads having their user agent set to Macintosh, making it hard to detect them as mobile devices using user agent string sniffing. You can change this with the PreferredContentMode preference in config.xml.

Example app

cordova-plugin-inappbrowser-popup-bridge-test contains a Cordova project which builds a test app for Android and iOS to illustrate usage of this plugin.

About

A fork of cordova-plugin-inappbrowser which adds Braintree's PopupBridge functionality to support PayPal payments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 37.2%
  • Java 30.9%
  • JavaScript 28.1%
  • HTML 2.5%
  • CSS 1.3%