iOS Facebook SDK: An active access token must be used to query information about the current user

前端 未结 5 2197
温柔的废话
温柔的废话 2020-12-30 06:01

I have followed many examples and looked at many questions regarding this access token error, but I can\'t seem to find out why I am getting it or how to fix it.

I i

5条回答
  •  半阙折子戏
    2020-12-30 06:34

    According to the docs, https://developers.facebook.com/docs/reference/ios/3.1/class/FBRequestConnection

    "The request uses the active session represented by [FBSession activeSession]."

    This applies to the static methods dealing with requests. So what you want to do is make sure you set the active session. Do the following:

    [FBSession setActiveSession:self.fb];
    

    Just before you call the first FBRequestConnection start* method.

提交回复
热议问题