Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass referrer data through chrome intent to google play

Tags:

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?

like image 746
Shing Avatar asked Jul 18 '14 21:07

Shing


2 Answers

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

like image 130
Praveen Yadav Avatar answered Nov 09 '22 21:11

Praveen Yadav


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.

like image 24
Kinlan Avatar answered Nov 09 '22 22:11

Kinlan