Android iOS nested Web page

Source: Internet
Author: User

We are now doing an activity page, Android and iOS activity page to do with the Web, easy to change, there are a few small problems;

1, in Android and iOS, although the Web can save Localstorage, but to the Android and iOS on the invalid, that is, can not store localstorage, and the cookie can be stored;

2, Android and iOS to the Web page this and simple, just need to write a normal function on the web side, in the Android and iOS direct call method, the following data is passed back parameters, such as

function Receiveappwishlist (data) {wish_list = Json.parse (data);}

3, the Web page to the Android and iOS, here is a little different, Android uses:

Window.toApp.productId (json.stringify (' argument '))

The above toapp is an object defined by Android; The method name is ProductId

iOS, however, is:

Window.webkit.messageHandlers.productId.postMessage ("argument")

The above iOS pass format is fixed, and the same ProductID is the method name. Window.webkit.messageHandlers. Method name. PostMessage ("argument")

Android iOS nested Web page

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.