Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to call up APP on HTML5 page

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to adjust APP on HTML5 page". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "how to adjust APP on HTML5 pages"!

Tag: iframe app href HTML5 timeout var adjusts APP location

In order to improve the exposure of app and the addition of app users, the application scenario of adding H5 sharing page is necessary, but the various platform environments are different, how to deal with the compatibility and strategy. I will explain them one by one below.

Set up native app and download APP

Compatibility and policy handling of different platforms, such as Wechat, Weibo, QQ,QQ Zone, browsers

The way android and ios are adjusted.

Schame + Android Itent

Schema + Universal links (IOS9+)

_ window.location.href= ""

Note: since it is impossible to determine whether the client is installed, the browser may jump to the error page through _ window.location=schema; so loading schema through iframe.src or a.href is a common method at present

Code implementation

Const iframeCallAPP= (url, downloadUrl, ios9Type) = > {

Console.log ('[iframeCallAPP1]'+ url)

Var timeout

Var t=Date.now ()

Var interval=ios9Type? 2500: 2000

Timeout & & clearTimeout (timeout)

Timeout=setTimeout (function () {

If (Date.now ()-t < interval+1000) {

}

}, interval)

If (ios9Type) {

Location.href=

}

Var docNode=document

Var iframe=docNode.createElement ('iframe')

Iframe.setAttribute ('src', url)

/ / iframe.setAttribute ('target',' _ self')

Iframe.setAttribute ('style',' display:none')

DocNode.body.appendChild (iframe)

SetTimeout (function () {

DocNode.body.removeChild (iframe)

}, 200)

}

WeChat

YingYongBao deeplink

micro-blog

Intermediate prompt page

It's like "Please open it in the browser."

When App is installed on the phone, the app will not be downloaded after it can be activated.

App is not installed, and after a while, download

H5 page call native app

Tag: iframe,app,href,HTML5,timeout,var, adjust, APP,location

At this point, I believe that everyone on the "HTML5 page how to adjust APP" have a deeper understanding, might as well to actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report