Custom URL scheme sometimes doesn't work on iPhone

I have an application where I need to receive a message from the server. The server sends a message in SMS. Since iPhone applications cannot receive SMS programmatically, I registered a custom URL scheme and my message prefix with a custom URL value for ex: mymsg:// .

This works great in most cases. Whenever an SMS message is received on the phone and I press the answer button, it returns me to the response state, and the original message will be displayed as a link that I can click to bring me to the application. For some reason this message is sometimes not clickable. That is, when I click on a message, it does not start the application or just the message is not clickable. Then, if I restart the phone, the link is activated again, and I can click the link that launches my application. Does anyone know what the reason is?

-chinnadurai

+6
source share
1 answer

I have encountered this problem before, but I'm not sure if this is the same as what you have. I found that regardless of whether the custom URL scheme in Message.app is configured, it is determined when the message arrives, and not when the user sees the URL.

This means that if you send your own scheme URL to the user before downloading the application, this link will never be clickable even if they start downloading the application later. I tested this behavior only on iOS 7.1 (did not check other versions).

In my case, I can’t guarantee that the user has already downloaded the application when sending the message, so my solution was to use the standard URL http:// , which redirects to the user URL myapp:// on the server with redirect 302. I hope this helps!

0
source

Source: https://habr.com/ru/post/887598/


All Articles