iPhone后台网络由定时器连接 [英] iPhone background network connection by timer

查看:208
本文介绍了iPhone后台网络由定时器连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写的应用程序,即每10分钟就应该从挂起模式被唤醒,经由GPS获得用户位置和通过网络发送该信息给服务器。

I need to write an application, that every 10 minutes it should be awaken from suspended mode, get user location via gps and send this information to the server by network.

取决于它应该返回到暂停模式或显示本地通知给用户的响应

Depending on the response it should return to the suspended mode or show local notification to the user.

有没有办法做到这一点在iOS 4?
我尝试过不同的方法,但对我来说唯一的工作就是开始backgroind监视用户位置和申报程序的位置,后台应用程序。在这种情况下它的工作背景,并具有网络连接。但这种方法需要大量的电力,而不是接受导致应用程序应该工作24/7。

Is there a way to do this on iOS 4? I've tried different approaches, but the only working for me was to start monitoring user location in backgroind and declare the application as location background application. In that case it worked in background and has a network connection. But this approach takes a lot of power and not accepted cause application should work 24/7.

可能有写一些守护进程应该在后台工作,并唤醒我的应用程序,每10分钟的方法吗?

May be there is a way to write some daemon that should work in background and wake my application every 10 minutes?

推荐答案

显然,<一个href=\"http://www.cultofmac.com/pastebot-uses-music-to-get-around-ios-4-multitasking-limitations/53686\"相对=nofollow> Pastebot 试图做的'声音'多任务声明(通过打一个无声的AudioFile)类似的东西,结果被拒绝了。直到他们实际上presented的一个选项,用户选择哪个AUDIOFILE他们想打。它现在是在AppStore。 :)结果

Apparently, Pastebot tried to do something similar with the 'audio' multitasking declaration (by playing a silent audiofile) and got rejected.. UNTIL they actually presented a option to the user to pick which audiofile they wanted to play. It's in the appstore now. :)

在这种情况下:是你为什么要不想使用的位置更新?如果电池的使用是一个问题,你可以用'唯一显著的位置变化'选项,之后就可以暂时更改为更准确的选择。

In this case: What is your reason for not wanting to use the location updates? If battery-usage is a concern, you can use the 'significant location changes only' option, after which you can temporarily change to a more accurate option.

这篇关于iPhone后台网络由定时器连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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