Our company recently in doing Baidu Wallet mobile web payment of a product, product use scenario is when the user through the Baidu Wallet scan our product QR code,
Enter our product, then the user selects the item and clicks on the purchase, then generates the order in our system backstage and submits the information to the Baidu Wallet to pay, when the payment is finished
We will automatically close the system page. This feature is available on Android phones, but cannot be turned off on iOS.
By contacting Baidu Wallet technical support, originally in iOS need to first add Runtimeready event to document, when Baidu Wallet SDK JS injection success
The Runtimeready event is triggered so that the associated close window action can be performed.
Here is the specific code:
var ua = Navigator.userAgent.toLowerCase (); Determine if the iOS device, other devices directly call Blightapp.closewindow () off if (Ua.indexof ("Apple")!=-1| | Ua.indexof ("Mac")!=-1| | Ua.indexof ("iphone")!=-1) {var event = document.createevent (' Events '); Event.initevent (' Runtimeready ', false,false); Document.dispatchevent (event);d Ocument.addeventlistener ("Runtimeready", function (e) { Blightapp.closewindow ( );} , false);} else{Blightapp.closewindow ();}
After testing on multiple iphone devices, you can close the page.
Baidu Wallet iOS Mobile HTML5 Web page does not automatically close the issue