Facebook、setReadPermissions 和 setPublishPermissions [英] Facebook, setReadPermissions and setPublishPermissions

查看:25
本文介绍了Facebook、setReadPermissions 和 setPublishPermissions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我正在尝试使用两种不同类型的权限.

Hey I'm trying to use two different type of permissions.

当我只使用一个时,一切正常.

When I'm using only one, all works fine.

但是当我同时使用它们时,应用程序崩溃了:

But when I'm using both of them the app crashes:

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)?

How can I add the 2 permissions (friends_games_activity and publish_actions) without problems?

推荐答案

在 SDK 3.0 中您不能同时拥有这两种权限,您需要将它们分开.您可以先打开 session 进行阅读,获取您想要的内容,然后 openForPublish.

You cannot have both permissions in SDK 3.0, you need separate them. You can first open session for read, get what you want and then openForPublish.

注意:在新的 SDK 中,您可以只要求读取权限首先打开一个会话.你不应该提示你的用户发布权限,直到他们实际发布对 Facebook 采取行动.这增加了用户的信任,也增加了可能性您的用户将选择从您的应用发布故事.到请求更多权限,使用 Session.openForRead 或Session.openForPublish.

Note: In the new SDK, you may ask only for read permissions when you first open a session. You should not prompt your user for publish permissions until the time at which they are actually publishing an action to Facebook. This increases user trust, and also the likelihood that your user will choose to publish stories from your app. To request further permissions, use Session.openForRead or Session.openForPublish.

您需要调用 clearPermissions.它在这里描述http://developers.facebook.com/docs/reference/android/3.0/登录按钮/#setReadPermissions(List)

You need to call clearPermissions. It's described here http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)

这篇关于Facebook、setReadPermissions 和 setPublishPermissions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆