安卓:从需要与分享对话框的Facebook应用链接主机API接收返回的数据 [英] Android: Need receive data back from Facebook App Link host api with Share Dialog

查看:181
本文介绍了安卓:从需要与分享对话框的Facebook应用链接主机API接收返回的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个本地唯一的应用程序,它具有共享RSS网址Facebook的分享功能。使用时点击后/故事,我想Facebook的打开我的应用程序,并通过一些数据来打开最佳的用户体验右视图。

I'm developing an native only application, it has a Facebook sharing feature that share a RSS url. When use click on a post/story I would like Facebook to open my app and pass some data to open the right view for best user experience.

我已阅读并创建一个应用程序链接,并获得canonical_url: https://fb.me/xxx 作为教程这里 https://developers.facebook.com/docs/applinks/hosting-api

I have read and created an app link and get the canonical_url: https://fb.me/xxx as the tutorial here https://developers.facebook.com/docs/applinks/hosting-api

我的共享对话框:

FacebookDialog dialog = new FacebookDialog.ShareDialogBuilder(activity)
                .setLink(link)
                .setName(caption)
                .setCaption(caption)
                .setDescription(description)
                .setPicture(imageUrl)
                .setApplicationName(activity.getResources().getString(R.string.app_name))
                .build();
        mUiHelper.trackPendingDialogCall(dialog.present());

如果我通过了链接参数是该网页的网址,例如 HTTP ://google.com/ ...,当我点击共享故事Facebook的打开浏览器加载网址

If I pass the link param is the web url, for example http://google.com/..., when I click on the shared story Facebook open the browser to load that url.

如果我通过了链接 param是canonical_url:的https:/ /fb.me/xxx ,Facebook的直接打开我的应用程序,并从Facebook接收到的数据是:

If I pass the link param is the canonical_url: https://fb.me/xxx, Facebook open my app directly and the received data from Facebook are:

Bundle[{extras=Bundle[{fb_expires_in=86400, fb_app_id=<app id>, fb_access_token=<access token>}], target_url=https://fb.me/xxx, referer_app_link=Bundle[{package=com.facebook.katana, url=fb:///, app_name=Facebook}]}]

我应该怎么做,使用后单击共享的故事,以获得RSS链接从Facebook回来?

What should I do to get the RSS url back from Facebook after use click on the shared story?

推荐答案

我想通了,只要把数据canonical_url后,所以当我回来从Facebook深度链接,解析URL接收返回的数据,例如
      https://fb.me/xxx?data=xyz&foo=bar

I figured it out, just put the data after the canonical_url so when I got it back from Facebook deep linking, parse the url to receive data back, for example https://fb.me/xxx?data=xyz&foo=bar

这篇关于安卓:从需要与分享对话框的Facebook应用链接主机API接收返回的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆