简体   繁体   中英

FBSession must be specified

While trying to use FacebookSDK in an iOS app, I get this message:

FBSDKLog: Error for request to endpoint '123654789?fields=name,supports_attribution,supports_implicit_sdk_logging,gdpv4_nux_enabled,gdpv4_nux_content': An open FBSession must be specified for calls to this endpoint

Why exactly do I get this?

I took the code from HelloFacebookSample provided with the FacebookSDK and put it into my app, but I must have missed some critical part.

You must be using Graph API v2.0. As the sample code is from older version, it is showing this error.

In the upgraded version the "/me/friends" endpoint no longer includes the full list of a person's friends. You need to add access token to make requests. Here is the link to the changes in v2.0

You can use the recently updated iOS-howtos for reference

In your application's *-Info.plist change "FacebookAppID" - "123654789".

Replace the temporary ID with your application ID.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM