1

我想以 24 小时之类的间隔调用服务。因此,如果我的应用程序当时也在后台,它也应该调用该服务。我支持位置更新,所以我的应用程序将在后台运行。但我想知道如何在不通知用户的情况下执行一些具有时间间隔的任务。谢谢

4

3 回答 3

0

我能想到的最好的事情就是与Parse集成。在那里,您可以设置在特定时间在后台运行的云代码。您还可以根据需要安排推送通知。否则,这是一个相当困难的情况。

于 2013-09-13T22:57:35.907 回答
-1

您可以使用NSThread方法在一段时间后在后台调用您的服务。

您可以按照此链接1链接2了解线程管理。

希望这会有所帮助..

于 2013-09-14T04:37:02.190 回答
-1
You can use this code in your app delegate  didfinishlaunching method
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidTimeout:) name:kApplicationDidTimeoutNotification object:nil];

and set timer according to that to perform your task at a particular time
于 2013-09-17T06:35:08.333 回答