プッシュ通知を追加するアプリケーションがあります。プッシュ通知をaletviewとして表示しています。ビューとキャンセルの2つのボタンがあります。ユーザーがビューボタンをクリックすると、特定のビューコントローラーに移動する必要があります。誰か助けてくださいそれを達成するために私は?これは私が通知で行った方法です。
- (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];
}
}
`