FacebookSdk.sdkInitialize (Context) is deprecated
From the documentation about upgrading SDK:
The Facebook SDK is now auto initialized on Application start. If you are using the Facebook SDK in the main process and don't need a callback on SDK initialization completion you can now remove calls to FacebookSDK.sdkInitialize. If you do need a callback, you should manually invoke the callback in your code.
Refer to: https://developers.facebook.com/docs/android/upgrading-4x
UPDATE
In SDK 4.22 the title
, description
, caption
and image
field of FBSDKShareLinkContent
are deprecated. Consider removing them from usage.
My requirement was to disable autoInit at app launch and initialise it from Activity's onCreate method. AutoInit before app launch was causing my flutter app to take time to start on slow network connections.
Disable AutoInit from manifest
<meta-data android:name="com.facebook.sdk.AutoInitEnabled" android:value="false"/>
Initialise Fb sdk in activity's onCreate method
FacebookSdk.fullyInitialize(); AppEventsLogger.activateApp(application);
FacebookSdk.sdkInitialize(getApplicationContext());
This method is deprecated so simply delete this line of code in your class. because according to the latest Facebook we now don't need to initialize the SDK manually, it gets initialize by itself.