I am now to distinguish between clicking the notification bar to enter the app or clicking on the app icon, 1, start the program is in the background. 2, accept the notification is in the foreground state. Applicationdidfinishlaunchwithoptions program starts for the first time and is not related to remote notifications
Application: (uiapplication *) application didreceiveremotenotification: No matter how you enter the program, it will be executed in foreground state. So now to distinguish whether to enter from the notification bar or click on the icon to encounter problems.
-(void) Application: (UIApplication *) application didreceiveremotenotification: (Nsdictionary *) UserInfo {
BOOL Bactivatedbynotification=no;
if ([uiapplication sharedapplication].applicationstate! = uiapplicationstateactive)
Bactivatedbynotification=yes;
}
Receive remote notification, how to distinguish is to click on the notification bar to go in or foreground received notification?