开发者

iOS iPhone GKSession discovery in background

I know that the system can close Bonjour sockets while the application is suspended. But ,开发者_JAVA百科will the system allow me while my application is in the background to only discover other devices not creating sockets to them and perhaps store those devices in a list or something like that ?


Use UIApplication's method

- (UIBackgroundTaskIdentifier)beginBackgroundTaskWithExpirationHandler:(void (^)(void))handler

you can run your code in background up to 600 seconds on iOS 4.x and later versions.


Your app can only run in background for audio, voip or location. So there is no way other then the previous mentioned methods to run an app in the background.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜