1

I'm very much a front-end guy, and I'm making a game for iOS/Android in Unity3d. I want to have a "Share on Facebook"-button in my game. When the user clicks it, it shares a link to the game on her facebook wall.

This part isn't so tricky - maybe I'll just use the prime31-plugin for that.

My question is about clicking the link on the facebook wall. Is it possible to achieve an user experience like the one outlined here:

if (user clicks from the iOS Facebook app)
{
    if (user has the app installed)
    {
        open app;
    }
    else
    {
        open App Store on the app’s page;
    }
}
else if (user clicks from the Android Facebook app)
{
    if (user has the app installed)
    {
        open app;
    }
    else
    {
        open Google Play on the app’s page;
    }
}
else
{
    open my apps homepage in standard browser;
}

1) First of all: If I create an "Facebook App" for the game, Facebook provides some kind of "App Links"... can they provide the behaviour I'm after?? (yes, I read a lot on it, but can't really get my head around if it fits my case)

2) If not, can I set up some kind of "AppLinks" in the top of the html on my webpage, so it functions the same way?

3) If not, can I use e.g. php-redirects on my webpage, to achieve the same flow?

Any thoughts or tips, tutorials or code samples, half or whole solutions are most welcome! I've searched the web for days, just getting increasingly confused.

So please help me in the right direction! :-) Thanx in advance!

user765151
  • 83
  • 1
  • 9
  • In general, there's not much you can do to dictate how Facebook will handle your links. What you can do is provide as much information as possible in your URLs to tell Facebook about your link, your native app, and your Facebook app, so that they can decide what to do. OG tags (like og:title, og:image, og:description) and App Links tags are the best ways to do that. – Ming Li Apr 30 '15 at 22:37
  • 1
    Yes, App Links can provide exactly the flow that you described; but your question is too broad. Go check out the docs on the matter from Facebook https://developers.facebook.com/docs/applinks/add-to-content, and http://applinks.org/documentation/ – CBroe Apr 30 '15 at 22:51

1 Answers1

1

See the comment by @CBroe; AppLinks is what you are looking for: http://applinks.org/documentation/

The basic structure is that you provide AppLinks-meta data on the pages that you are sharing. E.g. the following:

<html>
<head>
    <meta property="al:ios:url" content="applinks://docs" />
    <meta property="al:ios:app_store_id" content="12345" />
</head>
<body>
  <!-- Your page for non-app users -->
</body>
</html>

Now if a user clicks on a link that points to this page, from the FB mobile app, the in-app browser will recognise the AppLinks data. It will either provide an option to the user to:

1) Open the App, 2) Get the App from the store.

The exact behaviour depends per platform and app versions, etc.

Roemer
  • 3,566
  • 1
  • 16
  • 32