question

gogolon avatar image
0 Votes"
gogolon asked RobCaplan edited

How to initialize the Facebook SDK?

Hello,
I'm trying to integrate the Facebook SDK into my app (I'm using the official Xamarin.Facebook.iOS nuget). Everything works fine on Android but on iOS I'm getting a warning:

App events cannot be activated before the Facebook SDK is initialized. Learn more: https://github.com/facebook/facebook-ios-sdk/blob/master/CHANGELOG.md#900

How do I initialize the SDK?

dotnet-xamarin
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you manage to resolve this? I've just updated the Facebook SDK from v5.x to v9 for an older app and ran into exactly the same issue. I can't find any documentation saying how to initialize the Facebook SDK.

0 Votes 0 ·

@EK-4723 Hi, please have a look on this link: https://github.com/xamarin/FacebookComponents/issues/206
I haven't tried the suggestion that the other user made, but maybe it will help you.

0 Votes 0 ·

1 Answer

EK-4723 avatar image
1 Vote"
EK-4723 answered

Thanks @gogolon.

For future reference, it appears the solution is this:
In AppDelegate.FinishedLaunching(application, launchOptions)
make a call to:

Facebook.CoreKit.ApplicationDelegate.SharedInstance.FinishedLaunching(application, launchOptions);

Works for me! If only they'd make the documentation clearer ...

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.