I have developed an ios lib/framework
where i record user login and connect to the server and fetch data from server real time.
In the same library/framework
I would like to add observer to my application so that I come to know when the app went in background or became active again.
Something similar to what we usually do in the application code itself....(my test application code below. An observer functionality that i want to move to the common lib/framework
)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MyAppWillResignActive:) name:UIApplicationWillResignActiveNotification object:nil];
But even though i have defined the method as
void MyAppWillResignActive(id self, SEL _cmd, id application) {
NSLog(@"%s", __PRETTY_FUNCTION__);
}