0

When the scheduled NSLocalNotification was fired, if the app is running , or user select the detail in alert while app is in the background, the app delegate's didReceiveLocalNotification will be called.

While in the didReceiveLocalNotification method, is there a way to tell the app is running or in the background ?

Mayur Prajapati
  • 5,454
  • 7
  • 41
  • 70
Jerrylk
  • 379
  • 5
  • 19

1 Answers1

0

[[UIApplication sharedApplication] applicationState] returns an UIApplicationState, which is defined as:

typedef enum {
   UIApplicationStateActive,
   UIApplicationStateInactive,
   UIApplicationStateBackground
} UIApplicationState;
Marcelo
  • 9,916
  • 3
  • 43
  • 52