UNUserNotificationCenter+APPLocalNotification.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) 2013-2015 by appPlant UG. All rights reserved.
  3. *
  4. * @APPPLANT_LICENSE_HEADER_START@
  5. *
  6. * This file contains Original Code and/or Modifications of Original Code
  7. * as defined in and that are subject to the Apache License
  8. * Version 2.0 (the 'License'). You may not use this file except in
  9. * compliance with the License. Please obtain a copy of the License at
  10. * http://opensource.org/licenses/Apache-2.0/ and read it before using this
  11. * file.
  12. *
  13. * The Original Code and all software distributed under the License are
  14. * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  15. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  16. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  18. * Please see the License for the specific language governing rights and
  19. * limitations under the License.
  20. *
  21. * @APPPLANT_LICENSE_HEADER_END@
  22. */
  23. #import "APPNotificationContent.h"
  24. @interface UNUserNotificationCenter (APPLocalNotification)
  25. typedef NS_ENUM(NSUInteger, APPNotificationType) {
  26. NotifcationTypeAll = 0,
  27. NotifcationTypeScheduled = 1,
  28. NotifcationTypeTriggered = 2
  29. };
  30. #define APPNotificationType_DEFINED
  31. @property (readonly, getter=getNotifications) NSArray* localNotifications;
  32. @property (readonly, getter=getNotificationIds) NSArray* localNotificationIds;
  33. // List of all notification IDs from given type
  34. - (NSArray*) getNotificationIdsByType:(APPNotificationType)type;
  35. // Find out if notification with ID exists
  36. - (BOOL) notificationExist:(NSNumber*)id;
  37. // Find out if notification with ID and type exists
  38. - (BOOL) notificationExist:(NSNumber*)id type:(APPNotificationType)type;
  39. // Find notification by ID
  40. - (UNNotificationRequest*) getNotificationWithId:(NSNumber*)id;
  41. // Find notification by ID and type
  42. - (UNNotificationRequest*) getNotificationWithId:(NSNumber*)id andType:(APPNotificationType)type;
  43. // Property list from all local notifications
  44. - (NSArray*) getNotificationOptions;
  45. // Property list from given local notifications
  46. - (NSArray*) getNotificationOptionsById:(NSArray*)ids;
  47. // Property list from all local notifications with type constraint
  48. - (NSArray*) getNotificationOptionsByType:(APPNotificationType)type;
  49. // Property list from given local notifications with type constraint
  50. - (NSArray*) getNotificationOptionsByType:(APPNotificationType)type andId:(NSArray*)ids;
  51. // Clear specified notfication
  52. - (void) clearNotification:(UNNotificationRequest*)notification;
  53. // Clear all notfications
  54. - (void) clearAllNotifications;
  55. // Cancel specified notfication
  56. - (void) cancelNotification:(UNNotificationRequest*)notification;
  57. // Cancel all notfications
  58. - (void) cancelAllNotifications;
  59. @end