Facebook的Android SDK中会议openForPublish没有创造一个新的会话 [英] Facebook Android SDK Session openForPublish not creating a new session
问题描述
在当我打电话Facebook的Android SDK中
In the Facebook Android SDK when I call
Session tempSession = new Builder(this).build();
Session.setActiveSession(tempSession);
tempSession.openForRead(new OpenRequest(this).setPermissions(FB_PERMISSIONS));
它得到一个FB会话,每一件事情运行正常。但是,当我把读
与发布
。即遵循
Session tempSession = new Builder(this).build();
Session.setActiveSession(tempSession);
tempSession.openForPublish(new OpenRequest(this).setPermissions(FB_PERMISSIONS));
它给出了一个错误说,该会议是空的,并不能得到发布权限的空会话。
It gives an error saying, that the session is empty, and cannot get publish permissions to empty session.
你能告诉为什么会这样,什么将是处理这一问题的最佳方法是什么?
Can you please tell why is it like this and what would be the best way to handle this?
推荐答案
简单的回答是,不叫openForPublish。后来打电话openForRead,然后requestNewPublishPermissions如果你需要发布的权限。
The short answer is, don't call openForPublish. Call openForRead, and then requestNewPublishPermissions later if you need publish permissions.
长的答案是,你不能要求发布权限(谁在从未与Facebook通过您的应用程序,然后再连接一个用户),除非你已经有了基本的或默认权限已经(如果你调用openForRead一个空的东西,你会得到权限集)。所以openForPublish实际处理一个非常具体的利基的用例,大多数的应用程序可能没有。
The long answer is, you can't request publish permissions (on a user who's never connected with Facebook before via your app) unless you already have basic or default permissions already (what you would get if you call openForRead with an empty permission set). So openForPublish actually handles a very specific niche use case that most apps probably don't have.
这篇关于Facebook的Android SDK中会议openForPublish没有创造一个新的会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!