dougou8552 2012-08-06 11:45
浏览 22

如何通过add.php(Facebook)添加页面后将用户重定向到自定义URL

How can I redirect a user to just added page after adding it through add.php?

let's say my url looks like: http://www.facebook.com/add.php?api_key=API_KEY&pages=1

After selecting a page from the select box and clicking 'Add MY_APP_NAME' user is redirected to the wall of the page instead of to freshly added MY_APP.

Notice

I know this type of questions lots of here but i have no found any solution that why i put this question here again.... helps are definitely appreciated

Tried

I tried myself like this using Javascript but seriously not success

<script>
if (window == top) {
  top.location.href = 'https://apps.facebook.com/abc/' + document.location.href.replace(/https?:\/\/[^/]*\/?/, '');
}
function addToPage(page_id){
   top.location.href = 'http://facebook.com/add.php?api_key=<?php echo C_APP_ID; ?>&pages&perms=publish_stream&page='+page_id;
}
</script> 

See Image

enter image description here

  • 写回答

1条回答 默认 最新

  • dtyw10299 2012-08-06 11:56
    关注
    https://www.facebook.com/dialog/pagetab?  
      app_id=APP_ID&
      display=popup&
      next=https://facebook.com
    

    Using this alternative method you can specify the URL to be redirected to after interacting with the dialog to add an application to your page in the next parameter.

    You could try adding that parameter to your request.

    Other possible alternatives for the next parameter are -

    • redirect_url
    • redirect_uri

    Both are used elsewhere when dealing with redirecting users - perhaps one of them will assist you as well...

    评论

报告相同问题?

悬赏问题

  • ¥100 iOS开发关于快捷指令截屏后如何将截屏(或从截屏中提取出的文本)回传给本应用并打开指定页面
  • ¥15 unity连接Sqlserver
  • ¥15 图中这种约束条件lingo该怎么表示出来
  • ¥15 VSCode里的Prettier如何实现等式赋值后的对齐效果?
  • ¥15 流式socket文件传输答疑
  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接