0
我有一個應用程序,我添加推送notification.I顯示推送通知作爲aletview.with兩個按鈕視圖和cancell.i需要當用戶點擊視圖按鈕我需要去特定的viewcontroller .can有人幫我實現嗎?這我怎麼用notification.`做如何將操作添加到pushnotification alertview?
- (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];
}
}
`
我是這樣做的appdeleg ate.is有可能在此添加? – hacker 2012-07-18 14:28:44
是的,這是可能的 – 2012-07-18 14:30:23