Issue
I'm working with deep linking features for android and iOS, my back end is in CI. The deep linking is working for both Android and iOS when the application is installed. But if the application has not been installed then I face the problem.
I have tried it this way: When any user clicks on the link then first it will redirect to the browser, after that from my back end code I am checking that the client device type. If the device is Android then I am redirecting it to Android application, if the device is iOS then it redirect to iOS application. But when the application hasn't been installed, it stops working.
For Android I have put the following code:
header("Location: my.special.scheme://other/parameters/here")
For iOS have added the application scheme just before the URL.
I think I have described all my scenarios. Please guide me how it should be redirected to the app store or the specific page when the application is not installed.
Solution
Basically what happens is that you try to deep link using the URI scheme provided above (my.special.scheme://other/parameters/here
) and it fails since the app is not installed. In that case you cannot catch the failure and redirect the user elsewhere.
You can set your BE to return something similar to this:
window.location.href = "my.special.scheme://other/parameters/here";
setTimeout(function () {
window.location.href = ...store_link_for_your_app..;
}, 1000);
That way, if deep link fails, after 1s you'll get a redirect.
Important notes:
- Not all browsers support deep link via URI Schemes. In Chrome for example this will fail. here you'll have to use Intents, see https://developer.chrome.com/multidevice/android/intents
- In iOS 9+, safari browser will block usage of URI schemes if the app is not installed - you'll get an error on screen about your URL validity. Here you'll need to implement Universal Links, see https://developer.apple.com/ios/universal-links/
Answered By - Dror Davidi
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.