接受我们的应用发送的应用请求后,如何重定向到我的应用页面? [英] How can I redirect to my app page after accepted a app request sent from our app?

查看:80
本文介绍了接受我们的应用发送的应用请求后,如何重定向到我的应用页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Facebook申请(oauth2,图表)有疑问

I have a issue for facebook apprequests (oauth2, graph)

我向我的朋友B发送了一个应用程序请求. B登录到Facebook,并在应用列表中找到了我们的请求. B点击了接受按钮

I sent a app request to my friend B. B logged into facebook and found our request in the app list. B clicked the accept button

B重定向到Facebook画布页面.我要重新定向到我们的应用程序,而不是Facebook的画布,这可行吗?

B redirected to the facebook canvas page. I want to rediect to our app, not facebook's canvas, is this doable?

谢谢

推荐答案

您可以在数据参数中放置一个网址

you can put a url in the data param

请参见 http://developers.facebook.com/docs/reference/dialogs /requests/在底部的属性下.

see here http://developers.facebook.com/docs/reference/dialogs/requests/ under properties at bottom.

data可选,您可能会传递用于跟踪的其他数据.这将 被存储为创建的请求对象的一部分.

data Optional, additional data you may pass for tracking. This will be stored as part of the request objects created.

这将被传递回给您,您可以使用javascript来定位.将href指向数据中的网址.

This will get passed back to you and you can use javascript to location.href to the url in the data.

----------这是我过去使用的示例

----------Here is a sample i have used in the past

    var thisimg = 'AN_IMG';
    var thisurl = 'A_URL';  
    window.sendrequest = function(){
             FB.ui({ method: 'apprequests', 
             title: 'A request.',
        message: 'Rate Me! Request from: ' +thisname+' ',
        data: ''+thisimg+' '+thisurl+' ',
        filters: ['all'],
        });
        }

----------来自Facebook的示例,其中添加了数据参数.

---------- Sample from Facebook with data param added.

        var thisimg = 'AN_IMG';
        var thisurl = 'A_URL';
  function sendRequestToManyRecipients() {
    FB.ui({method: 'apprequests',
      message: 'My Great Request',
      data: ''+thisimg+' '+thisurl+' ',
    }, requestCallback);
  }

  function requestCallback(response) {
    // Handle callback here
  }


在回调时,您可以执行window.top.location.href ='';以及您传入数据的网址.


upon callback you can do a window.top.location.href=''; with the url you passed in data.

注意:请求的默认重定向是画布,无法更改.用户登陆画布后,您将从请求中读取数据参数并将其重定向到您的外部应用程序.

NOTE: The default redirect for a request is the canvas, this cannot be changed. After user lands on your canvas you will read the data param from the request and redirect them to your external app.

我看不到其他方法,因为requests2.0不包含重定向uri的选项."

"i do not see any other way to do this, since requests2.0 does not include option for a redirect uri."

这篇关于接受我们的应用发送的应用请求后,如何重定向到我的应用页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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