facebookbeacongoogle-nearbyproximityapi

Configure Google Nearby Notification API to use Facebook App Intent


Is it possible to pass Facebook's Android App intent while subscribing for Nearby Notification on Google Beacon Dashboard? I want to open my company's Facebook Page on the Facebook App when in proximity of the Beacon. In case it can be done, what should be passed in intent and scheme parameters?


Solution

  • In order to make this happen, you need to add a Nearby notification attachement url to your beacon. You can read an overview of how to do this here.

    Here's an example of constructing a the url to attach to your beacon. In order to go to a Facebook profile of Google, you can use a URL scheme to launch the native app like this:

    fb://profile/Google
    

    Since the native app (com.facebook.katana) may not be installed, Nearby allows you to specify a URL to launch in the browser if the app is not installed. You can set up an app intent URL with a web fallback for use on Nearby like this:

    intent://profile/Google#Intent;scheme=fb;package=com.facebook.katana; \
    S.browser_fallback_url=https%3A%2F%2Fwww.facebook.com%2FGoogle%2F;end
    

    See here for more info on how to construct such URLs.