如何检测应用程序打开时的推送通知
答
可以容易被你的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
}
}