很稳,初始化完成后调用了TrackAppOpened
一分钟调用一次CloseSession
退出前调用 CloseSession
代码如下:
AVAnalytics.InitAsync(new PC()).OnSuccess(t =>
{
AVAnalytics.Current.TrackAppOpened();
});
public void Update()
{
if (!_hasInit) return;
if (AVAnalytics.Current == null)
{
return;
}
if (Time.realtimeSinceStartup - _lastHeartbeatTime > HeartBeatInterval)
{
AVAnalytics.Current.CloseSession();
_lastHeartbeatTime += HeartBeatInterval;
}
}