12

We are trying to generate a link that, when clicked in a browser, opens our App if it's installed. This is usually done with something like this:

intent://some.domain/some=parameters#Intent;scheme=somescheme;package=my.package.name

If configured correctly, this uri can launch your App if it's installed, and redirect you to the play store otherwise. However, this is not what we want. We want to redirect to the play store with an install referrer. As far as we know, the intent:// syntax cannot do this.

Another solution we came up with was to make

market://details?id=my.package.name&referrer=somereferrer

openable with our App. The problem with this method is that it will not automatically launch the App, but rather ask the user whether they'd like to open the link with our App or the Play Store.

Any workaround for this? Even the slightest suggestion would be appreciated.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
cozyconemotel
  • 1,121
  • 2
  • 10
  • 22
  • I'd like to know why this question was down-voted. – cozyconemotel Mar 30 '15 at 07:54
  • install referrer is handled by playstore only. And providing install referrer is strictly formatted using https://developers.google.com/analytics/devguides/collection/android/v3/campaigns#google-play-url-builder – Ajay Kumar Meher Apr 02 '15 at 08:52
  • Wrong and totally irrelevant. The format of the referrer has nothing to do with our problem or any solution to it. – cozyconemotel Apr 02 '15 at 09:50
  • The PlayStore only understands what I posted in that link. Anything outside that link is not recognized by PlayStore. So there is no alternative to install referrer. – Ajay Kumar Meher Apr 04 '15 at 10:43
  • 3
    I don't think you understood my question. You're also wrong because the referrer parameter can be any string and the Play Store will send the Intent. The Google Analytics Receiver would't understand it, but you can use a custom Receiver.. irrelevant to the question but just fyi – cozyconemotel Apr 04 '15 at 22:35
  • `intent://some.domain/some=parameters#Intent;scheme=somescheme;package=my.package.name` does not opens my app. – 151291 Jun 05 '17 at 08:56
  • How to open my app if already installed ? – 151291 Jun 06 '17 at 05:31
  • Possible duplicate of [Android - redirect to store if app not installed (launch from website)](https://stackoverflow.com/questions/13518453/android-redirect-to-store-if-app-not-installed-launch-from-website) – rds Jun 15 '17 at 12:14

2 Answers2

10

I think this is your answer https://stackoverflow.com/a/28792160/5034920 Basically you must implement the intent filter like this:

<data android:scheme="https"
      android:host="www.foo.com"
      android:pathPrefix="/bar" />

and at the server side, create a redirect rule to google play. For example, https://www.foo.com/bar/BlahBlah will redirect to https://play.google.com/store/apps/details?id=com.bar.foo&referrer=BlahBlah.

Community
  • 1
  • 1
Ricardo Santos
  • 174
  • 2
  • 8
  • My app doesn't get caught the deep link actually it captured by play store due redirection to play store. do we need to make a rule for redirection?? – Mohit Dixit Jun 13 '18 at 07:17
  • I think there are two hypotheses for your problem: 1- Your browser is configured to always be responsible for opening url or 2 - a simple error in the configuration at intent filter (http: https: etc). you must call https://www.foo.com/bar/BlahBlah, this url only contains the rule for redirection (ex: javascript). – Ricardo Santos Jun 13 '18 at 19:24
1

I'm not sure 100% to have understood your question. I try to reformulate: you want your link to redirect to your app if installed without having the "open with" choice.

One solution, if you are developing for new Android M is to use App Link: here. But again, I'm not sure that is what you want.

gbaccetta
  • 4,449
  • 2
  • 20
  • 30