开发者

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

开发者 https://www.devze.com 2023-04-13 02:33 出处:网络
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.

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

精彩评论

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