gpt4 book ai didi

java - Facebook、setReadPermissions 和 setPublishPermissions

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:40:50 24 4
gpt4 key购买 nike

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

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

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

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

最佳答案

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

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/LoginButton/#setReadPermissions(List)

关于java - Facebook、setReadPermissions 和 setPublishPermissions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15727842/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com