开发应用程序 iframe 选项卡
我知道 facebook 中有几个免费的应用程序,如果用户是粉丝,可以使用这些应用程序访问 xyz.php 程序或显示图像。如果用户单击“喜欢”,则转到 vwx.php 程序或显示图像。我一直在尝试在 php facebook 应用程序中使用 FB.Event.subscribe 做与那些免费应用程序相同的事情,但我厌倦了尝试。我知道它应该很简单:
如果用户是粉丝 {location.href='xyz.php'} else{location.href='vwx.php'}
但我如何知道用户是否是粉丝
请帮忙!!! 谢谢
I know there are several free applications inside facebook that gives you the facility of if a user is FAN go to a xyz.php program or shows a image. If the user clicks "like" then go to a vwx.php program or shows a image. I have been trying to do the same as those free applications using FB.Event.subscribe inside a php facebook application but i'm tired of trying. I know it should be as simple as:
if user is fan
{location.href='xyz.php'}
else{location.href='vwx.php'}
BUT HOW DO I KNOW THE USER IS FAN OR NOT
please help !!!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该熟悉 *signed_request* 参数:
http://developers.facebook.com/docs /authentication/signed_request/
如果向下滚动页面,您会发现一个 PHP 函数,它向您展示如何验证和解码 *signed_request*。
将该函数添加到您的代码中并像这样调用它:
现在您可以以 PHP 数组的形式访问signed_request 中的对象:
You should familiarise yourself with the *signed_request* parameter:
http://developers.facebook.com/docs/authentication/signed_request/
If you scroll down the page, you'll find a PHP function that shows you how to verify and decode *signed_request*.
Add the function to your code and call it like this:
Now you can access the objects in the signed_request as PHP arrays: