在后台的iOS设备使用的入门通知 [英] Getting notification of iOS device usage in background

查看:130
本文介绍了在后台的iOS设备使用的入门通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能是我使用的是错误的标题,但我会尽量在这里解释我想要什么。

Might be i am using a wrong title but i will try to explain here what i want.

在iOS的我需要实现的功能得到通知,如果用户使用的是自己的iOS设备。

In iOS i need to implement a functionality to get notify if the user is using their iOS device.

我的应用程序会在后台使用位置服务在运行,我需要找出是否用户使用他们的设备。因为我已经看过这个应用程序,它是发送通知的背景是谁起诉他们的设备,而驾驶司机这是可行的。

My app will be running in background using location services and i need to find out if the the user is using their device. It is doable as i have looked into this application which is sending notifications in background to the drivers who is suing their devices while driving.

https://itunes.apple.com/fr/app/cellcontrol/id661169580?l=en&mt=8&ign-mpt=uo=2

所以我需要类似的这种功能,以找出是否一个用户正在使用iOS设备或没有。如果你们任何人都可以建议我的任何方法那么这将是巨大的,我开始。

So i need similar kind of functionality to find out if a user is using iOS device or not. If anyone of you can suggest me any approach then it would be great for me to start.

感谢您!

注意:我试图找出背景触摸事件,但是这是不可能的,因为我已经做了一些这方面的研究

Note: I have tried to find out touch events in background but that is not possible as i have done some research on this.

推荐答案

您将无法收到触摸事件时,应用程序使用的公共API的是在后台。然而,你可以做到这一点与MobileSubstrate有库的帮助( http://iphonedevwiki.net/index.php/ MobileSubstrate有 - 该MobileHooker组件是将被使用的一个)。通过挂钩的过程中对操作系统。作为一个例子,在Cydia显示记录应用程序追踪全球的手势,而录制屏幕。这将是一个cydia的好办法,你将需要越狱您的设备做了这一切。

You won't be able to receive touch events when the app is in background using public API's. However, you can do that with the help of mobileSubstrate library ( http://iphonedevwiki.net/index.php/MobileSubstrate - The MobileHooker component is the one that would be used). by hooking your process to the OS. As an example, the display recorder app in Cydia tracks global gestures while recording the screen. This will be a cydia tweak and you will need to jailbreak your device to do all that.

来到您的具体使用情况,你举的例子应用程序应该使用异常在<一提到后台应用程序之一href=\"https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html\" rel=\"nofollow\">https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html (请参见 - 实现长期运行的后台任务),这可能是一个接收来自外部配件的更新。

Coming to your specific use-case, the example app you cited should be using one of the exceptions for background applications mentioned in https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html (see the section - "Implementing Long-Running Background Tasks"), probably the one to receive updates from external accessories.

这篇关于在后台的iOS设备使用的入门通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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