0

I am using a url to redirect my app to facebook. One of the parameters for this is a url for redirection after the action is completed, which is where I need a link back to my app. I simply want it to go back to the app and wake it up again. Also it would be nice if this link could be used elsewhere, and would link to the play store if the application is not already installed or if it is clicked on using a desktop.

Thanks in advance, this will help me out a lot!

Joe Filler
  • 13
  • 6

2 Answers2

0

Take a look at the App Links protocol. One implementation is in Bolts.

EDIT: A bit more info... you could use a private URL scheme (yourapp://), but there is controversy over that because schemes are supposed to be universal, and "yourapp" is not. Also, the idea of linking to the play store if the app is not installed would not work.

App links works by embedding meta data into a web page, or by standardizing the OS-specific API used to launch an app (Intents, on Android). There is a further extension implemented by Facebook called App Link Hosting, which hosts the info on FB.

Sofi Software LLC
  • 3,879
  • 1
  • 36
  • 34
  • I have looked into this, but I believe it still requires you to set up a url scheme in the app itself. This is what I am having trouble understanding. – Joe Filler Nov 21 '14 at 21:39
  • Bolts implementation of App Links on Android uses Intents, not a URL scheme. – Sofi Software LLC Nov 21 '14 at 21:40
  • More info on the Android specific mechanism: http://applinks.org/documentation/#navigatingonandroid – Sofi Software LLC Nov 21 '14 at 21:42
  • I guess I am not familiar with the technicalities of this yet. What I want is a link to my app. I assume I can use app links to link to the store instead of the app is not installed. I am developing with unity, and do not know much about the java side of android development. – Joe Filler Nov 21 '14 at 21:52
  • Check the unity documentation on native plugins and extending UnityPlayerNativeActivity. It looks like you're going to have to do a little android native java development. – Sofi Software LLC Nov 21 '14 at 22:49
  • Sorry I should have. I was under the impression all I would have to do is add some things to the manifest file. I will look into that. – Joe Filler Nov 22 '14 at 05:46
0

you can refer to any app in the play store with:

             String uri = "market://details?id=" + pkgName;

where pkgName is the name of your app's package i.e. "com.android.example" You can start an activity that way as well

         Intent intent = new Intent(Intent.ACTION_VIEW);
         String uri = "market://details?id=" + pkgName;
         intent.setData(Uri.parse(uri));
         startActivity(intent);
Martin
  • 4,711
  • 4
  • 29
  • 37