Link to Google Play from Facebook - bypass internal browser - android

I'm trying to link from Facebook pages and posts directly to my app. I want the link to open in the Google Play application on Android devices.
Ever since Facebook started using an internal browser for links, links to https://play.google.com/details?id= and https://play.google.com/store/apps/details?id= from Facebook do not trigger the Play application, and are handled by the internal browser.
How can I bypass the internal browser and cause the Play application to catch the URL?
Thanks

Normally you would need to use the following protocol:
market://details?id=PACKAGE_NAME
But Facebook doesn't recognize this as a valid link. Only thing that comes to my mind is placing the above link behind an URL redirecting service. The problem is that most of these services don't allow to shorten links that do not begin with http. I've found a service that allows for custom protocols in the link, it's: http://bit.do/
Of course you could also create your own redirecting website if you have a place to host it.

As #k-m-Śliwiński has atated, we need to use the market:// scheme to fire up Play.
This is problematic for several reasons:
Facebook does not recognize this as a link.
URL shortening and redirection services do not recognize this as a link, so a device specific link (via smarturl.it for example) can not be issues.
The rare URL shortening services that do allow this are considered dangerous by Facebook and are blocked by it.
I ended up setting up a redirect (301) HTML webpage, storing it on one of my servers and creating a valid http:// URL pointing to it.
I've used the 301 Redirect Code Generator in the process.

Related

Is there a way to get scheme url of an installed app? (Android)

From the mobile web, I am trying to open an application that I installed from the store.
So far, I found out that apps can be opened by scheme URLs and deep links,
but couldn't find out a way to get the scheme URL of the app implemented by others.
The best I can do for now is open the google play store link.
Is there a way to open the app directly?
Seems like I didn't need the scheme URL after all.
I just needed to go to the google play store site and get the app id,
Then
location.href = market://launch?id={APP_ID};

Deep linking from Facebook Ad to 3rd party app

I'm trying to setup deep links from a Facebook Ad to an app that I do not own (Shopee). Shopee does not provide any facility/guides to deep-link to them at the moment. I've tested that the app has properly setup deep linking on Android, i.e. clicking the link https://shopee.ph/Korean-Mini-Cute-Sling-Bag-i.30650129.2385916193 on Slack or Gmail properly opens the Shopee app.
Is it possible to make deep links work on Facebook for apps that you do not own? So far, I've tried doing the steps detailed in https://developers.facebook.com/docs/app-ads/deep-linking/. However, I don't know where to get some of the platform settings needed by Facebook:
iOS
Bundle ID - where can I get this?
iPhone Store ID - Seems this can be easily taken when visiting the app store. I can get some of the details from https://shopee.ph/apple-app-site-association as well.
iPad Store ID - Similar to iPhone Store ID I guess.
Shared Secret - I'm someone who has no experience with iOS and Android programming. I'm afraid this setting is something that I couldn't get?
Android
Google Play Package Name - Should be com.shopee.ph
Class Name - I think this can be known by going through the app's apk/files
Key Hashes - Can this be taken from the app's apk/files as well?
I tried compromising by linking the Facebook ad to my website that has deeplinks. But clicking the links will just redirect Facebook's webview to the product's web info rather than opening the app.
I guess this question boils down to whether it's possible to get the app's Shared Secret for iOS and the Key Hashes for Android.
Any response will help me go to the right path or end the path altogether. Thanks.
Sorry, but if you don't own the app then you shouldn't possess shared secret and key hash of the app.
Shared Secret and Key hashes both are something that is very specific to the app created. It is mostly controlled by the app owner in case you need it you have to get that transferred from the app owner. But I doubt anybody will do that.
Also, this is some kind of hack that you are doing this should be definitely avoided without permission from the app owner.
If you are the owner then for
- Android you can try this url.
Have you tried with Android Intents? They can directly link to an app (including deeplink information). Of course you wouldn't now if its installed through adds beforehand. Firebase Dynamic Links solves that problem where you can decide to link to website or Play/App Store as fallback. They also open the native app from facebook browser (and others) and use Android Intents under the hood.
Think you can't use Firebase Dynamic Links for an app you don't own. But if redirecting to your own website is an option maybe you can implement a similar mechanic.
Here is the chrome documentation for Android Intents:
https://developer.chrome.com/multidevice/android/intents
Adjust also has a summary article about deep linking, covering Intents and iOS:
https://www.adjust.com/blog/dive-into-deeplinking/
As your expected behavior to open app but now it will just redirect Facebook's web view to the product's web. Unfortunately it is not currently possible to directly launch a third-party app from within the iOS Facebook app. This is a known issue that Facebook has essentially written off as wontfix. This is still possible in the Android Facebook app, but it's unfortunate they haven't been more transparent about the change to the iOS version because there is quite a bit of confusion about it.
But you cna do the same thing using services like Branch.io get around this by implementing a judicious combination of App Links, URI schemes, and iOS Universal Links. Essentially what you need to do is open a page in the webview and then have a button or other user-driven CTA event that launches the app from there. It's an extra step for the user, but currently the best workaround. If you just want to be able to post a link that goes into your app when it is installed and otherwise goes to a webpage (or the App/Play Store), then Branch links are definitely your simplest solution.

Do we have any mechanism to track if app is installed from a given URL?

Example:
Link : www.example.com/bje3x
The link will redirect to playstore or appstore url. So if user installs the app from the playstore, can we know if the app ins installed from the redirection URL above?
The question is tagged with firebase-analytics so I guess you are comfortable using Firebase. Then one possible solution for you would be to use Firebase Dynamic Links. They are designed for this use case.
In short you define what is your destination URL - kind of deep link - and if app is installed it just works as a deep link. If app is not installed, it can redirect to AppStore and then inside the app at launch you can retrieve your deep link. Of course it's a bit more complex than that, but essentially it allows you to know what brought the user in.
In the simplest form Dynamic Links use domain provided by Firebase (ending with .page.link) but you can also configure your own domain. Also you don't always get 100% matching accuracy, but for the most part - it should work.
There are also other solutions like branch.io etc. If you look for "deferred deep linking", "smart links" or "dynamic links" you will find more.
Yes we can achieve this by Deep Linking
A deep link is an intent filter system that allows users to directly enter a specific activity in an Android app. However there is an issue about this process. When a user click an URL, it might open a dialog which asks the user to select one of multiple apps handling the given URL.
On the other hand, An Android App Link is a deep link based on your website URL that has been verified to belong to your website. When user clicks that URL, it opens your app.
Please refer this Url
https://medium.com/#muratcanbur/intro-to-deep-linking-on-android-1b9fe9e38abd

Identify referrer URL after installation through Play Store

I have implemented Deep linking into my App: when the app is installed in the phone, it will open the app, else clicking on the browser it will redirect to the Google Play Store and give user the option to download the app.
My requirement is something like, when the user after clicking on the link gets redirected to Google Play Store and downloads the app, after successful installation of the app, the app should identify the URL from which it got redirected to the play store. I want to know whether it can be done via reading the intent or any other procedure is available to identify the same.
What you're describing is called Deferred Deep Linking (Deep Linking refers to using a link to open your app directly to a specific piece of content, and Deferred means that it works even if the app isn't installed first).
Unfortunately there's no native way to accomplish this on either iOS or Android. The Google Play INSTALL_REFERRER could work in theory, but it's unreliable and often gets delivered too late (i.e., seconds to minutes of waiting) to provide a good UX. URL schemes don't work, because they always fail with an error if the app isn't installed. Universal Links in iOS 9+ and App Links on Android 6+ at least don't trigger an error if the app isn't installed, but you'd still have to handle redirecting the user from your website to the App Store. You still can't pass context through to the app after install with Universal Links and App Links, so you wouldn't be able to send the user to the correct item.
To make this work, you need a remote server to close the loop. You can build this yourself, but you really shouldn't for a lot of reasons, not the least of which being you have more important things to do. A free service like Branch.io (full disclosure: they're so awesome I work with them) or Firebase Dynamic Links can handle all of this for you.
you can use FCM deep linking check this link dynamic-links

Using Google OAuth 2 on embedded Android-based device

We have an application for embedded Android-based device, it uses WebView and inside it we use Google OAuth 2 to login to the app. Unfortunately Google will soon block OAuth 2 inside WebView, and we have lots of restrictions:
The device doesn't have Google Services installed, so probably no 'official' way of logging in would work (or maybe any of them would work without Google Services?)
We can't just invoke Android browser to do login, because it shows address bar, which would allow the user to surf the internet, which we can't allow
We don't fully control the software installed on the device: can't install Google Services, update Android version, install Google Chrome, etc..., we can just update our app.
What else could we do having those restrictions?
Implementation through a browser:
1) Register custom URI scheme (How to implement my very own URI scheme on Android), for example, app-oauth2://
2) Make access request in user's browser
https://accounts.google.com/o/oauth2/v2/auth?
scope=...
access_type=offline&
include_granted_scopes=true&
state=state_parameter_passthrough_value&
redirect_uri=http://example.com/oauth2-handler&
response_type=code&
client_id=...
3) If user accept or denied requested rights in the confirmation dialog, it will be redirected to redirect_uri (http://example.com/oauth2-handler) with some params
4) On the side of redirect_uri handler (http://example.com/oauth2-handler), mare a redirect to custom URI scheme with params:
Success: app-oauth2://?state=state_parameter_passthrough_value&code=...&scope=...#
Failure: app-oauth2://?error=access_denied&state=state_parameter_passthrough_value#
5) In your app you can parse URI scheme app-oauth2:// from option 4 and receive the code for future usage or error for displaying to the user.
As per the problems on your side it would be best to open an Intent from within the App targeted towards the sign in Weburl [this won't trigger up address bar link]
Refer to this stackOverflow page
how to open "Add a Google Account" activity using intent?
now you may use Shared preferences to store the Authentication data for further logins [ if the requirements of the app permits it.]
https://developer.android.com/reference/android/content/SharedPreferences.html
You need to use OAuth Web services for implementing a solution based on your needs.
Reference link: https://developers.google.com/+/web/api/rest/oauth
Here is a sample github project that is using OAuth 2 web service for logging into Twitter. You can take help from it for consuming the Google's OAuth2 web services in your Android Application.
Repository link:
https://github.com/sathify/tagpulse
Web service consumption screen link:
https://github.com/sathify/tagpulse/blob/master/android/src/tag/pulse/main.java
I hope this helps.
There is a library that supports Android 1.5 and higher for Google OAuth 2:
Sample code found here:
https://github.com/google/google-api-java-client-samples/blob/master/oauth2-cmdline-sample/src/main/java/com/google/api/services/samples/oauth2/cmdline/OAuth2Sample.java

Categories

Resources