iOS iPhone GKSession discovery in background

739 Views Asked by At

I know that the system can close Bonjour sockets while the application is suspended. But ,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 ?

2

There are 2 best solutions below

6
rckoenes On

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
Andrey Zverev On

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.