首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LocalNotification On Click Not Handler

LocalNotification On Click Not Handler
EN

Stack Overflow用户
提问于 2013-05-28 15:47:55
回答 1查看 78关注 0票数 0

你好,我正在使用LocalNotifications开发一个应用程序。我想做一个处理程序,当用户在NotificationBar中点击通知时,它将显示他新的Viewctontroler与标题和描述,从通知接收。

代码语言:javascript
复制
 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 ];

 }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-28 16:12:41

您可以在中进行此处理

代码语言:javascript
复制
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16786590

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档