Baidu Wallet iOS Mobile HTML5 Web page does not automatically close the issue

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.