Configure Google Nearby Notification API to use Facebook App Intent

血红的双手。 提交于 2019-12-11 04:29:45

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38712719/configure-google-nearby-notification-api-to-use-facebook-app-intent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!