问题
I am using Facebook SDK for my android app. I am facing scroll lags and performance issues all over the app. Removing the sdk removes all the issues. But i intend to use the sdk for analytics purpose. Is there anything that has to be added with addition to sdk. Any insight is helpful.
I tried just adding the analytics implementation in gradle but still facing the same issues
implementation 'com.facebook.android:facebook-core:4.41.0'
implementation 'com.facebook.android:facebook-android-sdk:4.41.0'
回答1:
I have realized that the FB auto logging causes the lag. Specially when we put the app to background then bring it back to foreground for several times.
To disable the auto logging, add these to your manifest:
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled"
android:value="false"/>
ref: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#auto-events
I have no idea how and how can this feature make this serious problem..
来源:https://stackoverflow.com/questions/55523725/android-facebook-sdk-lowers-app-performance