22

So I have a mobile web that would try to open my android app, if it does not exist, it would fall back to google play.

for chrome, i use this intent:

intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name;end

and it works fine, now I want to send some referrer string to google play for the INSTALL_REFERRER in an app.

I tried the following link, it has no problem of sending data to google play, but it would not try to open the app

intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name&referrer=referrer_string;end

I wonder what is the correct way to open the app and fall back to google play with the referrer data being passed?

p u
  • 1,395
  • 1
  • 17
  • 30
Shing
  • 1,255
  • 1
  • 10
  • 18
  • did you find the solution? I am looking for the same. – Rahul Chauhan Jul 31 '14 at 06:36
  • I posted the same issue on chromium as well, hopefully they will reply soon, here is the link: [link](https://code.google.com/p/chromium/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Pri%20M%20Iteration%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&groupby=&sort=&id=395712) – Shing Aug 01 '14 at 19:22
  • 1
    I also have been trying to get this to work. I found the following article showing how to add extras to the intent http://stackoverflow.com/questions/16738276/how-do-i-pass-parameters-to-android-intent-in-new-scheme-on-chrome "Do Whatever" I unfortunately don't have a way to test if it adds the params to the google play URL – echappy Oct 27 '14 at 17:53
  • They closed that issue posted at Aug and merged it in the newer issue: https://code.google.com/p/chromium/issues/detail?id=459711 (it has "Unconfirmed" status for now...) – some.birdie Mar 16 '15 at 11:31
  • Ya, since they have no response, so i opened a new thread to poke them again =D – Shing Mar 16 '15 at 19:01
  • What about more cross-browser solution: http://stackoverflow.com/a/25374575/1298357 – Alex Klimashevsky Mar 26 '15 at 15:06
  • try like this http://stackoverflow.com/questions/16738276/how-do-i-pass-parameters-to-android-intent-in-new-scheme-on-chrome – Arun_SE Dec 15 '15 at 13:10

3 Answers3

5

Looks like it can be done by passing S.market_referrer=referrer_string

For example

intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name;S.market_referrer=referrer_string;end

I have not tested this, but there are some check-ins in the chromium repo for this, don't know if it is available in the current version of chrome.

https://codereview.chromium.org/2061493002

Praveen Yadav
  • 391
  • 4
  • 13
  • According to [the comment from dev member](https://bugs.chromium.org/p/chromium/issues/detail?id=459711#c35), “This change will be released in M53”, which will be [released on Sep 6th, 2016](https://www.chromium.org/developers/calendar). – hakatashi Sep 07 '16 at 04:41
  • @praveen-yadav, Yes perfect it works, at least on Android 6.0 – fralbo Nov 05 '16 at 22:13
1

This is a known issue that I am working with the team to get fixed. Someone in the past suggested that you can use intent://some_data_sent_to_app#Intent;scheme=app_scheme;package=package_name&referrer=referrer_string;end however the logic of this has never worked specifically because the Chrome browser (and Android Browser) look for a package id that is direct copy of the string which is parsed as package_name&referrer=referrer_string.

Kinlan
  • 16,315
  • 5
  • 56
  • 88
0

With the new scheme, you can pass arguments as extras to the App, but you must encode the URI as follow:

<a href="intent://whatever/#Intent;scheme=myapp;package=com.what.ever.myapp;S.myextra=mystring;end">Do Whatever</a>

source

Community
  • 1
  • 1
Arun_SE
  • 230
  • 1
  • 13