FBSession must be specified

4.8k Views Asked by At

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.

2

There are 2 best solutions below

3
On

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

0
On

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

Replace the temporary ID with your application ID.