开发者

Get Current Page Information immediately after authorization when app is installed as a tab

My facebook application is installed on multiple pages as a tab. When a user clicks on the tab link from a page, if the user has not authorized my app, I redirect the user for authorization.

After authorization, the user is redirected to my site with the "code" value. Now, at this point, I can get the "access token" for this user but I do not have the current page id.

I need the current page id in order to show the page specific data to this user.

However, after the user has authorized my user, when the user comes back later, i get the page information from the signed request. But I also need the page information immediately after 开发者_运维技巧authorization.


When your app first loaded as a tab, you can read the "signed_request" and compose the redirect_uri with it.

var encodeURI = encodeURIComponent("http://myapp.com?pageid=123");

and redirect your user to somewhere like

https://www.facebook.com/dialog/oauth?
     client_id=YOUR_APP_ID&redirect_uri=encodeURI&response_type=token
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜