【问题标题】:How can we get Local Notification in iPhone我们如何在 iPhone 中获取本地通知
【发布时间】:2011-07-13 07:32:50
【问题描述】:

我想根据用户定义的时间和日期添加通知。我该怎么做?

【问题讨论】:

    标签: iphone uilocalnotification


    【解决方案1】:

    你需要做什么在罚款documentation.中解释

    【讨论】:

      【解决方案2】:
      UILocalNotification *notif = [[UILocalNotification alloc] init];
      notif.alertBody = @"HI";
      [notif setFireDate:DATE];// fire the notification in ten minutes
      notif.alertAction = @"View";
      notif.timeZone = [NSTimeZone defaultTimeZone];
      [[UIApplication sharedApplication] scheduleLocalNotification:notif];
      

      【讨论】:

        【解决方案3】:

        设置UILocalNotification 并使用scheduleLocalNotification:UIApplication 安排它。

        【讨论】:

          猜你喜欢
          • 2023-04-03
          • 1970-01-01
          • 2011-03-23
          • 1970-01-01
          • 2017-07-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多