2013-05-28 70 views
0

你好我正在与LocalNotifications应用程序。我想创建一个处理程序,当用户点击NotificationBar中的通知时,它会向他展示具有标题和描述符的新Viewctontroler,它们将从Notification中接收。LocalNotification点击不处理程序

UILocalNotification *notif; 

     for(int i=0 ; i<[idnoty count]; i++){ 
     notif=[[UILocalNotification alloc]init]; 
      if (notif == nil) return; 


    notif.fireDate = [NSDate date];// Now here you can manage the fire time. 
    notif.timeZone = [NSTimeZone defaultTimeZone]; 
    [notif setHasAction:NO]; 
    notif.timeZone = [NSTimeZone localTimeZone]; 
    notif.alertBody = [titlenoty objectAtIndex:i]; 
     notif.alertAction=[descrnoty objectAtIndex:i]; 
     notif.applicationIconBadgeNumber = i+1; 
     notif.soundName = UILocalNotificationDefaultSoundName; 
    NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:@"Object 2",@"Key 2", nil]; 
     notif.userInfo = infoDict; 

       //apostolh gia na svisei ta push 
    NSString *URLTest=[dict objectForKey:@"URL"]; 
    NSString *URL1=[NSString stringWithFormat:@"%@%@",URLTest,@"push.php?"]; 

    NSString *strURL1 = [NSString stringWithFormat:@"%@id=%@",URL1,[idnoty objectAtIndex:i]]; 


NSData *dataURL1 = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL1]]; 

[[UIApplication sharedApplication] scheduleLocalNotification:notif ]; 

} 

回答

0

你可以这样做处理中

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification 
+0

和我如何会知道是什么录音通知。如果我有n + 1个通知? – Cliff

+0

这将与您在“通知中心栏/视图” – samfisher

+0

中互动的通知调用此方法将调用n + 1次? – Cliff