I want to know when my app is going to be suspend? The state of not being active for a certain amount of time or being terminated by the user. I need this because I need to close a connection a web socket. I want to keep the connection alive while the app is in the background state though.
How do I do this?
Thanks
You can also add Notification observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receiveSuspendNotification:)
name:UIApplicationWillResignActiveNotification
object:nil];
- (void) receiveSuspendNotification:(NSNotification*)notif
{
}
method will get called and you can perform the required tasks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With