简体   繁体   English

iPhone开发-检测用户活动

[英]iPhone Development - Detect User activity

Can someone please tell me if the following is possible when building an iPhone application. 有人可以告诉我在构建iPhone应用程序时是否可以进行以下操作。

I simply want small application that does the following: 我只想要执行以下操作的小型应用程序:

  1. Detects if the phone is being used so is the screen awake? 检测电话是否正在使用,屏幕是否醒着?
  2. Detect for active internet connection. 检测活动的互联网连接。

Are there easy libraries to use to work out this information. 是否有易于使用的库来计算这些信息。

- Detects if the phone is being used so is the screen awake? -检测电话是否正在使用,屏幕是否唤醒?

It is not possible as it will violate the privacy of the user. 这是不可能的,因为它会侵犯用户的隐私。 Unless you are talking about detect if your app is being used actively on foreground, background, suspended mode and etc, then it is a Yes. 除非您要谈论检测是否在前景,背景,挂起模式等上积极使用您的应用程序,否则它是“是”。

Example of code:- 代码示例:-

UIApplicationState state = [[UIApplication sharedApplication] applicationState];  
if (state == UIApplicationStateBackground || state == UIApplicationStateInactive){
    //Do Something
}
else{
    //Do Other thing
}

- Detect for active internet connection. -检测有效的互联网连接。

Yes, it is possible, I am using this https://github.com/tonymillion/Reachability 是的,有可能,我正在使用此https://github.com/tonymillion/Reachability

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iphone开发:在动画期间禁用用户交互 - iphone development: disabling user interaction during the animation 检测到用户对iPhone呼叫链接的确认? - Detect user's confirmation of iPhone call link? iPhone 检测到用户向上移动了他们的设备 - iPhone detect that user moved up their device 是否可以在后台检测用户的移动活动? - Is it possible to detect the user's moving activity on the background? 如何检测到该用户已在iPhone的设置中登录gmail? - How to detect that user already login gmail in iphone's settings? 如何检测用户已在其 iPhone 上滚动到网页底部 - How to detect user has scrolled to bottom of web page on their iPhone 有没有一种方法可以检测用户是否使用iphone 3GS或4浏览网站? - Is there a way to detect if user using iphone 3GS or 4 to browse the website? 如何检测用户使用GLPain绘制的字母... iPhone - How to detect alphabets drawn Using GLPain by user…IPhone 检测用户是否在 iphone 上浏览 safari 移动浏览器 - Detect if the user is navigating through the safari mobile browser on iphone iPhone Contact应用程序如何检测用户的数字是否与WhatsApp相关联? - How iPhone Contact app detect user has number linked to WhatsApp?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM