Android Facebook SDK lowers app performance

情到浓时终转凉″ 提交于 2020-04-30 10:03:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!