【问题标题】:How to implement a reminder calendar to my to-do list app?如何在我的待办事项列表应用程序中实现提醒日历?
【发布时间】:2015-06-26 22:08:56
【问题描述】:

我想在我的 To-DO 列表 View Controller 应用程序中添加一个提醒日历,因为用户可以添加日期和时间,并在它出现时从通知中心获得通知。我希望你能帮忙! 先感谢您!

【问题讨论】:

    标签: xcode calendar notifications push-notification reminders


    【解决方案1】:

    最好的方法是制作一个单独的“应用扩展”,作为小部件位于通知中心并与您的应用进行通信。

    否则你会有本地通知:

    UILocalNotification *localNotification = [[UILocalNotification alloc] init];
                [localNotification setRepeatInterval:NSWeekCalendarUnit];
                [localNotification setFireDate:[date dateByAddingTimeInterval:interval]];
                [localNotification setTimeZone:[NSTimeZone defaultTimeZone]];
                [localNotification setSoundName:sound];
                [localNotification setAlertBody:WAKE_UP_TEXT];
                [localNotification setAlertAction:@"Open"];
                [localNotification setHasAction:YES];
                NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[uidOfObject copy] forKey:@"myNotificationID"];
                localNotification.userInfo = userInfo;
                [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
    

    【讨论】:

      猜你喜欢
      • 2012-12-29
      • 1970-01-01
      • 1970-01-01
      • 2020-11-21
      • 2022-12-03
      • 2021-07-03
      • 1970-01-01
      • 2012-02-10
      • 1970-01-01
      相关资源
      最近更新 更多