Pass referrer data through chrome intent to google play - android

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?

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

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.

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

Related

Deeplinking Squareup pos app is not working

The documentation link: https://developer.squareup.com/docs/pos-api/build-mobile-web#step-5-test-your-code suggest straight forward code like this:
<a href="intent:#Intent;
action=com.squareup.pos.action.CHARGE;
package=com.squareup;
S.browser_fallback_url=https://my.website.com/index.html;
S.com.squareup.pos.WEB_CALLBACK_URI=https://my.website.com/index.html;
S.com.squareup.pos.CLIENT_ID=sq0ids-yourClientId;
S.com.squareup.pos.API_VERSION=v2.0;
i.com.squareup.pos.TOTAL_AMOUNT=100;
S.com.squareup.pos.CURRENCY_CODE=USD;
S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CASH;
end">Start Transaction</a>
I tested it and it does not open any link, my devide already have app installed.
When I try this code:
Take a QR code 2
It open play store app with squareup pos app information, I need to directly open the app and not play store screen of the app, is there any way?
*UPDATE:
I got transactions to work after adding S.com.squareup.pos.LOCATION_ID={{ my_location_id }}. The location ID can be found in Square Developer Portal > Locations. Also if the POS app is passcode protected, you have to open and login with passcode before sending transaction.
*END UPDATE
I've been working through this same issue. I still haven't gotten a transaction to work, but have at least gotten the app to open.
Make sure the CLIENT ID is your production application ID. NOT sandbox.
The WEB_CALLBACK_URI needs to match the Web Callback URL defined in your Square Developer Portal > Point Of Sale API.
I hope this helps. If you do figure this out and get transactions to work, please post your solution for me and others who are sure to run into this issue since the documentation is lacking.

Android - Pass data from link to app when installed and launched

I want to implement an app invitation, which I can share to users via a link
Hi, you've been invited to so and so. Click here to accept!
http://myapp.com/?foo1=bar1&foo2=bar2
The link itself will redirect to the google play store, but I want to keep the foo1 = bar1, foo2 = bar2. And when the application has been launched, I want to get that data and do something with it.
Is this at all possible?
If there's not, is there another way that I could go about this?
Thanks!
You could use the Google Play referrer API. There is a a library, the Play Install Referrer Library which wraps this in a slightly easier to use interface.
getting data from the download url
`https://play.google.com/store/apps/details?id=com.example.myapp&referrer=utm_content%3Dgroup232`
after first install, get the referrer and its content (eg. get "group232")
Check here for more details
https://developer.android.com/google/play/installreferrer/library

What to put for website when registering android app with instagram api?

I am new to Android and am confused on what to put for the URL fields when registering a new client with the Instagram API using their web form.
I'm specifically confused as to what to put for these fields:
Website URL
Valid Redirect URIs
I am making an Android app and it doesn't have a website, so what am I supposed to be putting here?
In my search for an answer that made sense to me, I found this: http://oferei.com/2013/06/serverless-instagram-authentication/
In short, this is what one would need to know about how to fill these fields if they are registering an app that does not have its own website:
Website URL: it doesn't matter what value goes here, I used localhost
Redirect URIs: The article above specifies a custom URI scheme, but this is not supported w/ the Instagram API anymore. However, I did see that also using localhost would work here as well in this article: http://jelled.com/instagram/access-token
Not sure if that is the best practice, but it is a way to get the client ID for an Android app.

Android Play Store market:// link is no longer working?

I've been redirecting my users for the past year from my domain:
http://example.com/get
to: market://details?id=com.example.myapp
Today I've check this on Nexus 5/LG G3/OnePlus One from the chrome browser app and it stopped working!
Now, when my users try to download the app they are redirected to a broken link.
Anyone know anything about this change in the Chrome app in Android?
from reading the chrome's version 40 release, there are some insight i d like to share
http://blog.chromium.org/2014/12/chrome-40-beta-powerful-offline-and.html
they updated to Content Security Policy Level 2, which has a stronger control over redirects.
https://w3c.github.io/webappsec/specs/content-security-policy/#changes-from-level-1
The path component of a source expression is now ignored if the resource being loaded is the result of a redirect, as described in ยง4.2.2.3 Paths and Redirects.
Redirects are blocked by default, and explicitly allowed with a new unsafe-redirect expression.
So I did some testing. if your initial action started from redirect (no matter window.location or http 302) it will show an error. but once i created a hyperlink to market:// and explicitly clicked it, it worked fine.
for now i ended up creating a webpage in between, where i ask the user to click the link to proceed.
I was testing this url on different devices with different OS/Play Store/ Play Services/ Browsers. looks like it's related to browser but not OS or Play Services.
Initially I updated Play Services and Google Play Store and my old Chrome (v18) was opening market://details?id= url fine.
Afterward I had updated my Chrome (v18) to version 40. And it's not working any more.
Meanwhile, FireFox and default "Browsers" still opens this url and redirects to Google Play Store app.
P.S. I have registered issue in Chromium bug tracker. Let's see if there will be any response:
https://code.google.com/p/chromium/issues/detail?can=2&q=market&colspec=ID%20Pri%20M%20Week%20ReleaseBlock%20Cr%20Status%20Owner%20Summary%20OS%20Modified&id=454396&thanks=454396&ts=1422888121
UPDATE [6.05.15] : Unfortunately, they decided not to fix this issue, saying, that it's planned behaviour. As they said, user should click the link by himself. Only then re-direct to the app on devices is allowed.
So, there is only one "work-around", that I see for now: create a page, that contains text like "Click link below to go to the app", followed by link like:
Load Example App
or
<a href="intent://foo.bar#Intent;scheme=blabla;package=com.example.myapp;end" > Load App/ Activate your Profile </a>
Try the link below, replacing your.app.id with your own identifier:
https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=your.app.id&ddl=1&pcampaignid=web_ddl_1

link to publisher in google play not working

In my native android app i have a "more apps" button which I want to link to all my apps on google play.
I'm following this link: http://developer.android.com/distribute/tools/promote/linking.html#UriSummary
As per the documentation in the link above, i used this query: market://search?q=pub:publisher_name. For publisher name i used my name without the brackets. BUT when i run the app and click on the "more apps" button, the google play store app opens and shows this message:
No results found for "pub:my_name_here"
If i remove the "pub" the url like this:market://search?q=publisher_name
then it shows all my apps. But the problem is that along with my apps, other apps are also being shown which match my surname. Not sure how to resolve this. All i want is to link to only my apps on google play.
I tried searching on Google, StackOverflow but did not find the solution. I tested this on Galaxy Note II. Not sure if it is a device specific issue. Has anyone come across something like this? Thanks!
Just to add to this, I also had this issue and found that adding quotation marks around my developer name solved it.
Instead of this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:Liam Cottle"));
Change it to this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:\"Liam Cottle\""));
The Google Play store app will only show results which match the quoted name exactly... Well, that's what I found anyway.
We have the same issue and the old link used to work up until now.
The workaround so far is to use
Intent marketIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://play.google.com/store/search?q=Vendor+Name"));
startActivity(marketIntent);
This works, but this is triggering the open with window and it also requires us to update every single app.
Edit: The provided answer by Liam does not work as this is the exact link and quotation we have been using for years, which just recently stopped working, the only working solution is using the web link above.

Categories

Resources