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 ];
}
和我如何会知道是什么录音通知。如果我有n + 1个通知? – Cliff
这将与您在“通知中心栏/视图” – samfisher
中互动的通知调用此方法将调用n + 1次? – Cliff