如何指定包含 #
的 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_uri
为http://website.com/foo
时,它会重定向到:
https://website.com/foo?post_id=100006935442054_1384656491776519#_=_
不确定尾随的 #_=_
的用途,但它不会在此处引起任何问题。
当redirect_uri
为http://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/