简体   繁体   English

HybridAuth Facebook-“更新用户状态失败!”

[英]HybridAuth Facebook - 'Update user status failed!'

I have integrated latest version of HybridAuth in my website, I have created Facebook app as well, but when I use the function 我已经在我的网站中集成了最新版本的HybridAuth,我也创建了Facebook应用,但是当我使用该功能时

$facebook->setUserStatus("Test"); 

it return for me error message: 它为我返回错误信息:

Fatal error: Uncaught exception 'Exception' with message 'Update user status failed! Facebook returned an error: OAuthException: (#200) The user hasn't authorized the application to perform this action' in /home2/codinghe/public_html/inc/hybridauth/Hybrid/Providers/Facebook.php:204

I think by default, Facebook config allow already publish and write stream in HybridAuth. 我认为默认情况下,Facebook配置允许已在HybridAuth中发布和写入流。 The issue can be in my facebook app ? 问题可以在我的Facebook应用程序中吗? here is how it looks: 这是它的外观:

http://easycaptures.com/fs/uploaded/743/9943073222.jpg http://easycaptures.com/fs/uploaded/743/9943073222.jpg

Do you have any idea please? 你有什么主意吗? Thank you for your help. 谢谢您的帮助。

@user3308323, did you initialize the Hybrid_Auth class and authenticate the user, before calling the setUserStatus() method? @ user3308323,在调用setUserStatus()方法之前,您是否初始化Hybrid_Auth类并验证用户身份? See an implementation example below as presented on the official page( http://hybridauth.sourceforge.net/userguide/Profile_Data_User_Status.html ). 请参见下面的官方网站上提供的实现示例( http://hybridauth.sourceforge.net/userguide/Profile_Data_User_Status.html )。

Hope this answers your question. 希望这能回答您的问题。

// init hybridauth
$hybridauth = new Hybrid_Auth( $config );

// try to authenticate with facebook
$adapter = $hybridauth->authenticate( "facebook" );

// update the user status
$adapter->setUserStatus(
array(
"message" => "", // status or message content
"link" => "", // webpage link
"picture" => "", // a picture link
)
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM