Facebook AppInviteContent: SDK has not been initialized, be sure to call the FacebookSdk.sdkInitialize () function

When I try to run AppInviteContent as shown below:

AppInviteContent content = new AppInviteContent.Builder() .setApplinkUrl("....") .setPreviewImageUrl("https://amazingslider.com/wp-content/uploads/2012/12/dandelion.jpg") .build(); AppInviteDialog.show(activity, content); 

I get an error. The SDK was not initialized, be sure to call the FacebookSdk.sdkInitialize () function:

 04-09 02:46:50.429: W/System.err(5960): The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first. 04-09 02:46:50.429: W/System.err(5960): at com.facebook.internal.Validate.sdkInitialized(Validate.java:145) 04-09 02:46:50.429: W/System.err(5960): at com.facebook.FacebookSdk.getCallbackRequestCodeOffset(FacebookSdk.java:896) 04-09 02:46:50.429: W/System.err(5960): at com.facebook.internal.CallbackManagerImpl$RequestCodeOffset.toRequestCode(CallbackManagerImpl.java:110) 04-09 02:46:50.429: W/System.err(5960): at com.facebook.share.widget.AppInviteDialog.<clinit>(AppInviteDialog.java:75) 

but I don’t understand, because FacebookSdk.sdkInitialize (Context) is deprecated now :( why am I getting this error?

im in Delphi if that matters

+5
source share
1 answer

Just use the obsolete FacebookSdk.sdkInitialize (); until.

Auto-init uses content providers that do not work on some devices with modified Android. I have had thousands of crashes and deletions from my users.

I reported this problem a few months ago and they still haven't fixed it, instead they just closed the problem.

+2
source

Source: https://habr.com/ru/post/1266512/


All Articles