Android Facebook SDK降低了应用程序性能 [英] Android Facebook SDK lowers app performance
问题描述
我正在为我的Android应用程序使用Facebook SDK.我在整个应用程序中都面临滚动滞后和性能问题.删除sdk会删除所有问题.但是我打算将SDK用于分析目的.除了sdk之外,还有什么要添加的吗?任何见解都是有帮助的.
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.
我尝试仅在gradle中添加分析实现,但仍然面临相同的问题
I tried just adding the analytics implementation in gradle but still facing the same issues
实现'com.facebook.android:facebook-core:4.41.0'
implementation 'com.facebook.android:facebook-core:4.41.0'
实现'com.facebook.android:facebook-android-sdk:4.41.0'
implementation 'com.facebook.android:facebook-android-sdk:4.41.0'
推荐答案
我已经意识到FB自动日志记录会导致延迟.特别是,当我们将应用程序置于后台,然后将其多次返回到前台时.
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..
这篇关于Android Facebook SDK降低了应用程序性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!