The method setLocalDispatchPeriod(int) from the type GAServiceManager is deprecated

ぐ巨炮叔叔 提交于 2019-12-05 00:44:52

The reason for the deprecation is outlined in the ServiceManager JavaDoc:

This only works if local dispatching is in use. Local dispatching is only used in the absence of Google Play Services on the device or if manually forced (see setForceLocalDispatch()). In general, applications can not rely on the ability to set the dispatch period. This method should therefore be used with some discretion.

If you are using EasyTracker, you can also specify ga_dispatchPeriod in your analytics.xml file, which should not throw a lint warning about deprecation.

<resources>
  <string name="ga_trackingId">UA-XXXXXXXX-X</string>

  <integer name="ga_dispatchPeriod">30</integer>

  <!-- [...] -->
</resources>

See the Dispatching page of the docs.

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