Facebook Feed Dialog API 如何包含包含# 的redirect_uri?

标签 facebook url redirect deep-linking fragment-identifier

如何指定包含 #redirect_uri

Facebook Feed Dialog API parameters reference

redirect_uri - The URL to redirect to after a person clicks a button on the dialog. Required when using URL redirection.

当相关的 redirect_uri 是常规 URL 时,这会按预期工作,但是,当它包含 # 时,它就会停止工作。

redirect_urihttp://website.com/foo时,它会重定向到:

https://website.com/foo?post_id=100006935442054_1384656491776519#_=_

不确定尾随的 #_=_ 的用途,但它不会在此处引起任何问题。

redirect_urihttp://website.com/#foo时,它会重定向到:

https://website.com/?post_id=100006935442054_1384656491776629#_=_

因此看来,# 后面的参数要么被忽略,要么被 #_=_ 覆盖

鉴于我正在使用单页面应用程序,其路由由哈希片段驱动,这破坏了我在应用程序中深度链接的能力。

任何有关如何解决此问题的帮助/建议将不胜感激!

最佳答案

在您的应用程序中,您可以像处理哈希标签一样处理查询字符串,或者只是进行重定向。

例如,如果您的路线是 http://website.com/#foo,则使 http://website.com/?hash=foo 执行以下操作同样的事情或将 ?hash=foo 重定向到 #foo

关于Facebook Feed Dialog API 如何包含包含# 的redirect_uri?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19697692/

相关文章:

google-app-engine - 在 GAE 中使用自定义域规范化静态站点的 URL

jsp - 一般 tomcat (v7) 404 重定向到外部 url

Facebook 登录返回用户个人资料中的 'Undefined' 字段,但不返回电子邮件。 MEANJs + 护照-facebook

javascript - Facebook likebox 深色方案不可读

facebook - 我无法在 Facebook 页面墙时间轴上发帖

javascript - codeigniter 无法在单独的 js 文件中回显 site_url

html - 我应该把图像放在哪里,以便我可以将它用作 og :image?

java - 是否有特定于 URL 的 hashCode 方法?

javascript - 更改哈希值时重新加载页面

php - htaccess 文件 : Force going to https instead of http except for specific pages