I want to implement deferred deep linking in my android app. My understanding is I need to provide a url and when user opens the url, it will direct user to the app or to play store if the app has not been installed. From my research, seems Android is able to resolve deferred deep linking by default. But my question is where is the URL from? Does Google have any url builder to generate it for me or do I need to have a website and write some code for the url?
The answers and comments so far are all referring to normal deep linking. None of them will get you deferred deep linking (i.e., the ability to deep link even when the app is not installed yet and the user needs to first visit the Play Store to download it).
Vanilla iOS does not support deferred deep linking at all. Android can do it with the Android Google Play referrer, but it is unreliable and doesn't work at all from Chrome.
To do this, you'll likely want to investigate a free third-party service like Branch.io (full disclosure: I am on the Branch team). The Branch platform abstracts all the technical details and edge cases away, so all you need to worry about is defining a set of key/value parameters (for example: articleID: story123
) when you create a link. Branch makes sure those parameters are returned to you inside the app the first time it launches after the user clicks the link, whether or not the app was installed when the link was clicked. You can then use the values to route/customize however you wish.
Firebase Dynamic Links seems to be the official Android way to support the deferred deep link that will send user across the installation UI if needed. It also works with iOS and Web.
The url comes from any app or the user. Its just a normal app in the form http://example.com/path. THe magic is that your manifest registers an intent filter for the http scheme and the example.com/path path, and Android will take any intent that has an ACTION_VIEW for that url to your app. If your app isn't installed, since its an http url it falls back to the browser. If the url happens to go or redirect to the play store, then it gets you that behavior as well.
You can try using this scheme(to be sent to the user):
intent://details?id=X&url=Y&referrer=Z#Intent;scheme=market;action=android.intent.action.VIEW;package=com.android.vending;end";
X: Package name of the App
Y: Deep link scheme which should be defined in the App's manifest. (Please refer this) Here, they have used this URL as an example: "http://www.example.com/gizmos" , therefore Y should be replaced by this URL.
Z: Can be any data which you want to pass to the App via Google Play. Please take note that any data which you pass should not be '&' separated because the original parameters are itself '&' separated.
From what I experimented, this URL is understood by the browser and it redirects you to the App based on the package name and the deep-link scheme. Else it takes you to the Google Play.
PS: The Google Play makes a broadcast to the app. So make sure you receive the broadcast in a receiver.
© 2022 - 2024 — McMap. All rights reserved.