脸谱,setReadPermissions和setPublishPermissions(Facebo

2019-08-18 09:06发布

嘿,我试图用两种不同类型的权限。

当我使用的只有一个,一切工作正常。

但是,当我使用他们两人的应用程序崩溃:

LoginButton authButton = (LoginButton) view.findViewById(R.id.authButton);
authButton.setReadPermissions(Arrays.asList("friends_games_activity"));
authButton.setPublishPermissions(Arrays.asList("publish_actions"));

我怎么可以添加2个权限( friends_games_activitypublish_actions没有问题)?

Answer 1:

你不能在SDK 3.0这两种权限,你需要将它们分开。 你可以先读公开会议,得到你想要什么,然后openForPublish。

注意:在新的SDK,你可能只要求读取权限,当你第一次打开的会话。 你不应该提示用户进行发布权限之前的期间,他们实际上是发布至Facebook的行动的时候了。 这增加了用户的信任,还您的用户会选择从发布您的应用程序故事的可能性。 以请求进一步权限,使用Session.openForRead或Session.openForPublish。

你需要调用clearPermissions。 它在这里描述http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)



文章来源: Facebook, setReadPermissions and setPublishPermissions