Find list of Local Notification the app has already set

后端 未结 8 1865
盖世英雄少女心
盖世英雄少女心 2020-12-01 05:37

My app allows users to set a number of reminders in the future. When the app lauches I want to know what reminders (notifications) have already been set.

Can I read

8条回答
  •  猫巷女王i
    2020-12-01 06:07

    @Scott Berrevoets gave the correct answer. To actually list them, it is simple to enumerate the objects in the array:

    [[[UIApplication sharedApplication] scheduledLocalNotifications] enumerateObjectsUsingBlock:^(UILocalNotification *notification, NSUInteger idx, BOOL *stop) {
        NSLog(@"Notification %lu: %@",(unsigned long)idx, notification);
    }];
    

提交回复
热议问题