开发者

Facebook page apps - Authorizing a user

开发者 https://www.devze.com 2023-02-08 14:13 出处:网络
I can\'t seem to find exactly what I\'m looking for. We\'re trying to build an app to run solely on a Facebook Page. We want to show a landing page if they don\'t Like the page, and the contest entry

I can't seem to find exactly what I'm looking for. We're trying to build an app to run solely on a Facebook Page. We want to show a landing page if they don't Like the page, and the contest entry form if they do. This functionality works.

Before showing the contest entry form, we'd like to authenticate the user viewing the app so that they can just hit "Enter the contest!" and we can automatically pull a name/email address.

Any of the methods of authentication I've seen described, including through the 开发者_JAVA百科Facebook Developer docs, don't work at all.

I saw something that said they need to interact with the app first, then you can get the id, but that doesn't work either. I also don't get the page id passed with the signed request.

Its also pretty unclear whether I should be using an iframe or just FBML.

Could anyone point me in the right direction, please? Thanks!


  1. You need to create a fan page and add the FBML plugin to that page, then you will need to insert a short code that will determine if a facebook user has clicked 'Like' or not and by determining that you will decide weather to display the content of the landing page or not (using an iframe). You will probably like to also set the FBML box that you create as the default view for members who didn't press the 'Like' button yet, you can change the default view in your fan page settings.

  2. On the iframe, you will need to use the Facebook API if you want to retrieve any user information from Facebook, for that, you will need to register a new application with Facebook. Go to developers.facebook.com for the API integration and app registration.

Also, what do you mean when you say:

Any of the methods of authentication I've seen described, including through the Facebook Developer docs, don't work at all.


Well, it appears you can't do it that way. The client was very specific in wanting that functionality but we ended up convincing them to go for a redirect to the canvas page to have the app authorized and the contest entered instead.

0

精彩评论

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

关注公众号