如何设置权限" publish_actions"在LoginButton使用Facebook SDK? [英] How to set permission "publish_actions" in LoginButton using facebook sdk?
问题描述
我要发布在Facebook时间轴上的图片。我使用LoginButton设立许可
publish_actions.But我得到错误信息
I want to post a picture on facebook timeline. I am using LoginButton to set up the permission of publish_actions.But I got error message
"com.facebook.FacebookException: Cannot pass a publish or manage permission (publish_actions) to a request for read authorization."
是否有任何人知道如何设置权限在LoginButton?
Does any one know how to set the permission in LoginButton?
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
uiHelper = new UiLifecycleHelper(this, callback);
uiHelper.onCreate(savedInstanceState);
LoginButton loginButton = (LoginButton) findViewById(R.id.loginButton);
loginButton.setReadPermissions(Arrays.asList
("publish_actions","user_friends", "email" , "user_photos" ));
loginButton.setTextColor(Color.TRANSPARENT);
loginButton.setCompoundDrawablesWithIntrinsicBounds(0,0,0,0);
loginButton.setBackgroundResource(R.drawable.fb);
}
任何建议将AP preciated。
Any suggestion will be appreciated.
推荐答案
您不能添加发布有setReadPermissions权限,因为它似乎。有在这个线程pretty好的答案:<一href=\"http://stackoverflow.com/questions/15727842/facebook-setreadpermissions-and-setpublishpermissions\">Facebook, setReadPermissions和setPublishPermissions
You cannot add publish permissions with setReadPermissions as it seems. There is a pretty good answer in this thread: Facebook, setReadPermissions and setPublishPermissions
基本上,你不应该在同一时间要求读取和写入权限。应用程序不应该登录后直接张贴在墙上用户反正东西 - 只对特定的用户交互
Basically, you should not ask for read and write permissions at the same time. Apps should not post something on the user wall directly after login anyway - only on specific User interaction.
这篇关于如何设置权限&QUOT; publish_actions&QUOT;在LoginButton使用Facebook SDK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!