Facebook SDK: FBLoginView reauthorizating for publish stream

大城市里の小女人 提交于 2019-12-10 20:14:21

问题


I have a problem of reauthorizating the publish stream after calling the initWithReadPermission when using FBLoginView. I try to call inside the delegate function where i can get the user information. After the next dialog asking for publish stream permission, the application threw me an exception saying

"'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: It is not valid to reauthorize while a previous reauthorize call has not yet completed.' "

I need to call after the read permission but how to prevent this problem?


回答1:


According to your error the FBSession is not opened. so you should check if the session is

opened before trying to reauthorize.




回答2:


In the facebook sdk doc somewhere they state that you should not get read and write permission at the same time.

The best approach would be init with Read permission, and then as soon as the user does an action that require write permission, ask for it in a second time (which is what they want you to do actually, also because if you use iOS6 SSO, for read and write permission i think you need to click 2 different alert views, it cannot be done in 1 single authorization click)

if you really need to get both read and write in a sequence, try with a NSNotification when you successfully get the read authorization, and then try to get the write permission when you get that notification.



来源:https://stackoverflow.com/questions/15180991/facebook-sdk-fbloginview-reauthorizating-for-publish-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!