facebook-android-sdk
facebook-android-sdk copied to clipboard
The call FacebookSdk.setAutoInitEnabled(true) don't start initialization process
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing Github issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Java version
1.8.0.291
Android version
API 28, Android 9
Android SDK version
16.1.3
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
Init facebook SDK manually
Expected results
Facebook SDK should be initialized
Actual results
Facebook skip initialization because of the method initializeIfNotInitialized() in UserSettingsManager class. Looks like the first condition should be the opposite. Now we return from this method when Facebook is not initialized.
private fun initializeIfNotInitialized() {
if (!FacebookSdk.isInitialized()) {
return
}
if (!isInitialized.compareAndSet(false, true)) {
return
}
userSettingPref =
FacebookSdk.getApplicationContext()
.getSharedPreferences(USER_SETTINGS, Context.MODE_PRIVATE)
initializeUserSetting(autoLogAppEventsEnabled, advertiserIDCollectionEnabled, autoInitEnabled)
initializeCodelessSetupEnabledAsync()
logWarnings()
logIfSDKSettingsChanged()
}
Steps to reproduce
- Run the app
Code samples & details
// INSERT YOUR CODE HERE