如果当前app处于活动状态,走didReceiveRemoteNotification方法处理;如果是从通知中心进来,在
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法里面处理
if (launchOptions):
{NSDictionary *localNotif = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
// NSDictionary * dict1 = [localNotif valueForKey:@"aps"];
//do something what u want.
// [[[UIAlertView alloc] initWithTitle:[dict valueForKey:@"title"]
// message:[dict valueForKey:@"alert"]
// delegate:nil cancelButtonTitle:@"OK"
// otherButtonTitles:nil, nil] show];
BetaTownMessage *message = [[BetaTownMessage alloc] init];
[message setPushTitle:[localNotif objectForKey:@"title"]];
[message setPushContent:[localNotif objectForKey:@"content"]];
BetaTownMessageInfoViewController *messageInfoviewController = [[BetaTownMessageInfoViewController alloc] init];
messageInfoviewController.message = message;
[self.navigationController pushViewController:messageInfoviewController animated:YES];
}