App delegate gets callbacks indicating iOS app state transitions. We can identify if the iOS app is running in background or inactive using this.
Also "applicationState" in UIApplication gives the current state of the iOS app.
[[UIApplication sharedApplication] applicationState]
The below objective-c code snippet gives an example of checking the iOS app stateUIApplicationState state = [[UIApplication sharedApplication] applicationState];
if (state == UIApplicationStateBackground || state == UIApplicationStateInactive)
{
//Do checking here.
}