javascript - iframe in h5 page cannot invoke iOS application?
扔个三星炸死你
扔个三星炸死你 2017-06-17 09:16:17
0
1
854

In a web page opened in Safari on iOS, when a button on the page is clicked, if the user has installed a specific application A, then open application A, otherwise jump to the download page of application A in the AppStore, online The search result is to use ifame. When the click action occurs, the src of the iframe is set to the URL Schemes preset in application A. However, after actual operation, I found that even if application A is installed on the iPhone, the application cannot be invoked using iframe. A, does anyone know why this is? ? Is it related to the iOS system version? ps: The iPhone system version I am using is 10.3.2
The following is the js code that uses iframe to invoke the iOS application:
var ifr = document.createElement('iframe');
ifr.src = scheme_IOS; //Apply the URL Scheme defined in A
ifr.style.display = 'none';
document.body.appendChild(ifr);
setTimeout(function() {

document.body.removeChild(ifr);

}, 2000);

扔个三星炸死你
扔个三星炸死你

reply all(1)
阿神

For ios9 and above, just use window.location.href = scheme_IOS.

Universal Link is recommended for ios9 and above

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template