How to initialize the Facebook SDK?

gogolon213123 21 Reputation points
2021-04-06T18:05:37.81+00:00

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?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,364 questions
{count} votes

Accepted answer
  1. EK 176 Reputation points
    2021-06-23T15:02:53.94+00:00

    Thanks @gogolon213123 .

    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 ...

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.