简体   繁体   English

iPhone后台服务开发

[英]iPhone Background Services Development

I am developing an iphone application and I think that it's business logic requires a service to be always running in background. 我正在开发iphone应用程序,我认为它的业务逻辑要求服务始终在后台运行。

The service needed is to get the acceleration of the device and notify or perform a certain action when that acceleration becomes a certain value. 所需的服务是获取设备的加速度,并在该加速度变为特定值时通知或执行特定操作。

Is that allowable in the Apple policies, or is there any idea about a solution? 苹果政策允许这样做吗,或者对解决方案有任何想法吗?

What cydia development possibilities to help me ? cydia开发有哪些可能帮助我?

Well, an application can run in the background and Apple perfectly accepts this however the user will obviously be be able to close the application (or should be able to) via the multi-tasking bar and this will end the application. 嗯,一个应用程序可以在后台运行,Apple完全接受这一点,但是用户显然可以通过多任务栏关闭(或者应该能够)关闭该应用程序,这将结束该应用程序。 Period. 期。

Apple will not accept an application that runs constantly regardless of whether the user has is in background state as this drains the battery, heats the device etc. So an application can run in the background so long as the user can quit it when close it from the multi-tasking bar however it cannot continue to run after the user closed it via multi-tasking - if it does continue, Apple will reject the application. 无论用户是否处于后台状态,Apple都不会接受会持续运行的应用程序,因为这会耗尽电池电量,加热设备等。因此,只要用户可以从后台关闭程序退出该应用程序,该应用程序便可以在后台运行。多任务栏,但是在用户通过多任务关闭它后它不能继续运行-如果继续,Apple将拒绝该应用程序。

Also, see 2.16 of the Apple Store review guidelines: https://developer.apple.com/appstore/resources/approval/guidelines.html#functionality 另外,请参阅Apple Store审查指南的2.16: https : //developer.apple.com/appstore/resources/approval/guidelines.html#functionality

Dbramhall left out one important thing: Dbramhall遗漏了一件重要的事情:

You can't guarantee that your app won't be killed, the OS can kill apps that are in the background at will if it requires more memory. 您不能保证不会杀死您的应用程序,如果操作系统需要更多内存,则可以随意杀死处于后台的应用程序。

So if at all possible i wouldn't rely on making sure it can run its process in the background and before you ask "How can i stop this?". 因此,如果可以的话,在您询问“我如何停止此操作?”之前,我将不会确保它可以在后台运行其过程。 Well you shouldn't I've never tried it myself because i don't know the effects it has on the OS. 好吧,您不应该自己尝试一下,因为我不知道它对操作系统的影响。

Also if you stop it from being killed in the Background, if it is going to be on the app store then it won't pass evaluation process, because it breaks the OS 另外,如果您阻止它在后台被杀死,如果它要在应用商店中,那么它将不会通过评估过程,因为它破坏了操作系统

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM