简体   繁体   中英

iOS deep linking/redirecting if app isn't installed

I'm not sure this is possible, and I've read a number of answers to questions about deep linking on SO, so I figured I'd ask.

I understand that as developers, we can add custom URL schemes to our app, so that if I send a friend a custom link, it should open a particular page in my app. However, I'm wondering if there's any way at all to handle something like this if the app isn't installed on my friend's phone. Ideally I'd like to redirect my friend to the App Store page for my app, but I can't think of any way that could be done. Thanks in advance for any suggestions!

This is a very discussed thread ... if you search stack overflow you will find the solution already answered by someone.

Let's think you will send the URL to your friend through Mail or Message app. At this moment, you don't know if your friend will open this URL from his iPhone, Android, PC, console or whatever ... so you have to think that you can not resolve this problem thinking only in Obj-C solution.

You will have to prepare a server and an API, upload your real URLScheme link, get a token or something, and based on this token, make a http link to your server. When your friend click the link, safari will open, and using javascript etc your will check if the device is an iPhone, and if is, you will try to call your urlscheme from there, using a solution posted on this thread. If you are not on iPhone, you can redirect the page to your App's HomePage or somewhere explaining what's happening.

Hope it helps.

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