脸谱,setReadPermissions和setPublishPermissions [英] Facebook, setReadPermissions and setPublishPermissions

查看:334
本文介绍了脸谱,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权限(<$ C C $> friends_games_activity 和 publish_actions )没有问题?

推荐答案

您不能同时拥有权限在SDK 3.0,你需要将它们分开。你可以先打开的会话进行读取,得到你想要的东西,然后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。它在这里描述 <一href="http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)">http://developers.facebook.com/docs/reference/android/3.0/LoginButton/#setReadPermissions(List)

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

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

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