Deep linking not able to fallback to google market?
Asked Answered
W

1

6

Below is my scenario:

  1. If the app is installed, launch the app pass a referrer data and handle it inside the app.
  2. If the app is not installed , direct to google play install the app handle the referrer data.

I am able to achieve first case

For scenario 1 , I have

link 1:

http://www.xxx.co.in/main?id=4&referrer="+referrer

My activity is configured correctly and I am able to achieve scenario 1.

For scenario 2, I have

final String url = "http://www.xxx.co.in/main?id=4&referrer="+referrer+"#Intent;scheme=market;action=android.intent.action.VIEW;package=com.xxx&referrer="+referrer+";end";

This I am not able to achieve, If the app is not installed, instead of directing me to google play, it tries to open www.xxx.co.in/main.... in browser.

What is wrong here and how to achieve this.

NOTE: I do not want to host my own server hence redirecting from a remote server is out of scope.

Welltimed answered 29/9, 2016 at 22:30 Comment(1)
Quite baffled to see no answers on thisWelltimed
K
0

Are you opening this link in the native Android browser, or Chrome? That looks like an Intent link, so it will only work in Chrome even if it is formatted correctly. However, Chrome doesn't support the Android Play referrer

To be honest, this sounds like a perfect use case for an external deferred deep linking service like Branch.io (full disclosure: I'm on the Branch team). Branch links do exactly what you're describing, and they do it on all browsers while saving you from the headache of needing to handle all the different variations. All you need to worry about is defining a set of key/value parameters (for example: articleID: story123) when you create a link, and 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.

Kaneshakang answered 1/10, 2016 at 4:22 Comment(2)
Thanks for the answer Alex. I am using chrome. Are you sure chrome does not support referrer? I have been using link2 for referral. for quite some time (chrome 40). I still believe it is possible to achieve both without using a remote server, ( I may be wrong, but I am still to be convinced). The fact that both methods are working independently so I am not sure why should they not work together.Welltimed
Actually it looks like it may be have recently been added to Chrome. What version are you using?Kaneshakang

© 2022 - 2024 — McMap. All rights reserved.