Search code examples
iosiphoneios7reachability

IOS Reachability notification in Background


I want to do some tasks as soon as user comes online even he is in background. I am using Reachability class for checking internet. But this class is not notifying me when i am at background. I know people asked this question earlier but didn't got any solutions there. If i use beginBackgroundTaskWithExpirationHandler. It gives me 3 to 4 min only, after that if network change i am not getting any notification. Please suggest me something.I think it is possible because native mail app work in that manner and my app support iOS7 only.


Solution

  • You cannot get notification form your classes while the app is in the background, you can make use of the new iOS 7 background fetching possibilities. Here is a tutorial http://www.objc.io/issue-5/multitasking.html