In my application I need to capture the network connectivity status change while connecting or disconnecting even when my app is in the background. I have implemented Reachability class.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reachabilityChanged:) name:kReachabilityChangedNotification object:nil];
I am receiving the notifications successfully when app is in foreground. But when I keep the app in background and when there is any change in the network I did not receive any notification.
Could any suggest me on how to get this.
My actual requirement is I am using NSURLSessionConfiguration & DownloadTask which I need to cancel when there is a network connection lost even when the app in background.
So I wanted to get the network changed notification even in the background.
[I am using objective c and I need to support from iOS9]
can anyone please help me. thanks