跟踪在申请中花费的时间 [英] Track time spent in application

查看:112
本文介绍了跟踪在申请中花费的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用什么来追踪使用者在iOS装置上使用我的应用程式的时间长度?



我想我可以这样做:


  1. 记录应用程式启动时的时间(应用程式:didFinishLaunchingWithOptions:

  2. 应用结束时的日志时间( applicationWillTerminate:

  3. 列表项

发送报告(开始/退出时间对)到服务器并计算在应用程序中花费的时间



你有什么更好的想法? / p>

重要的是有效的网络和资源

(不要在复杂的计算操作上发送大量数据或使用iOS资源。)

解决方案

请注意,当按下主页按钮时不会调用 applicationWillTerminate:



查看 applicationDidEnterBackground: applicationWillEnterForeground:



更多此处


What should I use to track how long is user using my application on iOS devices?

I think I can do it like this:

  1. Log time on App startup (application:didFinishLaunchingWithOptions:)
  2. Log time on App ending (applicationWillTerminate:)
  3. List item

Send report (pairs of start/exit time) to server and count time spent in app

Do you have any better ideas?

Important is to be network and resources effective
(not to send big amount of data or consume iOS resources on complex computing operations.)

解决方案

Notice that applicationWillTerminate: is not necessarily called when the home button is pressed (this changed from iOS 3.X to iOS 4.0).

Take a look at applicationDidEnterBackground: and applicationWillEnterForeground:

More here.

这篇关于跟踪在申请中花费的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆