我有一个应用程序,我在其中添加推送通知。我将推送通知显示为 aletview。有两个按钮视图和取消。当用户单击视图按钮时,我需要转到特定的视图控制器。任何人都可以帮忙我实现了这一点?这就是我处理通知的方式。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
NSLog(@"########################################didReceiveRemoteNotification****************************###################### %@",userInfo);
//check application in forground or background
if(application.applicationState == UIApplicationStateActive)
{
//NSLog(@"FOreGround");
//////NSLog(@"and Showing %@",userInfo)
}
else {
NSDictionary *curDict= [userInfo objectForKey:@"aps"];
UIAlertView *connectionAlert = [[UIAlertView alloc] initWithTitle:@"app" message:[NSString stringWithFormat:@"%@",[curDict objectForKey:@"alert"]] delegate:self cancelButtonTitle:@"View" otherButtonTitles:@"Cancel",nil];
[connectionAlert show];
[connectionAlert release];
[UIApplication sharedApplication].applicationIconBadgeNumber =[[curDict objectForKey:@"badge"] intValue];
}
}
`