如何检测应用程序打开时的推送通知

问题描述:

在我的应用程序中,我使用了推送通知服务,但我的问题是,当我关闭应用程序时,通知出现,但是当我打开应用程序,然后发送通知通知不来。请帮帮我。如何检测应用程序打开时的推送通知

可以容易被你的appDelegate.m

---实现application:didReceiveRemoteNotification:

实例下提到这个功能处理: -

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
{ 

    UIApplicationState appState = [application applicationState]; 
    if (appState == UIApplicationStateActive) 
    { 

      UIAlertView *alertVw = [[[UIAlertView alloc] initWithTitle:@"Notify" message:yourMessage delegate:self cancelButtonTitle:@"Done" otherButtonTitles: @"vizllx", nil] autorelease]; 

      [alertVw show]; 
    } 
    else { 
     // Push Notification received while app is in background 
    } 
}