facebook->getUser() 返回 0
我认为这是因为用户必须授予对我的 facebook 应用程序的某种访问权限,以便我可以使用 getUser ?这是我的代码:
<? require 'facebook.php'; ?>
<?php
$facebook = new Facebook(array(
'appId' => '[//fb app id]',
'secret' => '[//fb app secret]',
'cookie' => true
));
$uid = $facebook->getUser();
echo $uid;
?>
所以我想我的问题是,除了提示用户向我的应用程序授予权限之外,是否有任何其他类型的唯一标识符我可以从 Facebook 用户那里获取,以防止他们提交超过 1 个条目我的应用程序。我有用户的添加提交,但我只想允许每个用户 1 次提交。感谢您的帮助!
I assume that this is because users have to grant some sort of access to my facebook application, for getUser to be available to me? Here is my code:
<? require 'facebook.php'; ?>
<?php
$facebook = new Facebook(array(
'appId' => '[//fb app id]',
'secret' => '[//fb app secret]',
'cookie' => true
));
$uid = $facebook->getUser();
echo $uid;
?>
So I guess my question is, short of prompting the user to give permission to my app, is there any other sort of unique identifier that I can grab from a fb user to prevent them from submitting more than 1 entry to my app. I have user's add submissions, but I only want to allow 1 submission per user. Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获取用户id,用户必须授予权限
用户授予权限后(参见loginUrl),您可以访问用户id
To get user id, user have to grant permission
After the user grant permission (see the loginUrl), you may access user id