简体   繁体   中英

What Javascript event gets fired when iOS Safari gets called from another app

I'm working on a mobile website / iPhone app combination. Upon entering the mobile website, I prompt the user to 'go to the app', 'download the app', or 'use mobile website'.

From various entry points to the mobile website, I'm mostly worried about verification emails and text messages, so the user will check email, follow the verification link, enter Safari, get prompted to 'go to the app' and the verification link is sent to the app for it to handle.

Now in the same session, if the user gets another email regarding the app, the user will check email again, follow a different verification link to Safari, and I want the 'go to the app' to work the same with the new link.

Some quirks are that upon entering the mobile website, the verification link is stored and the URL is switched to example.com/home. The iPhone overlay is completely separate from the rest of the site and doesn't have access to the site's storage of the verification link so the event needs to fire as soon as the site loads. This works when first loading the page, but upon re-entering the second time, I need to listen to event that triggers as soon as iOS Safari re-enters. I've tried listening to "pageshow" but by that time, the URL is already example.com/home.

I doubt the solution here is Javascript. To load any Javascript code, the page must already be downloading and <html><head> already downloaded (at least). I believe the only way to get what you want would be to do it in the backend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM