Get Facebook fan page-id in page tab app using javascript

浪子不回头ぞ 提交于 2019-12-20 06:19:56

问题


Can I get Facebook fan page-id in page tab app without authorizing user using javascript? And also if I authorized user and after that I get signed_request which only contains

["algorithm","code","issued_at","user_id"] not "page" object. How can I get "page" object?

I want to add Page tab app similar to Pinterest Page App, which initially get UserId/UserName and after that if we open that app then it will directly open according to inserted UserId/UserName.


回答1:


No, you can not.

The page info is send only in the signed_request that gets POSTed to your app so with JavaScript, you have no access to POST data. But you can easily access with server side language.

You might found a lots of PHP code for it..for C# you can use below code..

string signedR = Request["signed_request"];

I hope this might be helpful to you...@Mirant




回答2:


Can I get Facebook fan page-id in page tab app […] using javascript?

No, you can not.

The page info is send only in the signed_request that gets POSTed to your app on initial load into the iframe – and with JavaScript, you have no access to POST data.

The signed_request you get from the JavaScript SDK is a “different one”, it contains info about the auth status and user only, not about the page.

I want to add Page tab app similar to Pinterest Page App, which initially get UserId/UserName and after that if we open that app then it will directly open according to inserted UserId/UserName.

I don’t understand what you mean by that exactly. And I don’t see what this has to do with the page id, when you are only speaking of the user id/user name here?



来源:https://stackoverflow.com/questions/36140505/create-new-page-tabs-facebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!