EMNotificationHelper.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // EMNotificationHelper.h
  3. // ChatDemo-UI3.0
  4. //
  5. // Created by XieYajie on 2019/1/10.
  6. // Copyright © 2019 XieYajie. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. typedef NS_ENUM(NSInteger, EMNotificationModelStatus) {
  11. EMNotificationModelStatusDefault = 0,
  12. EMNotificationModelStatusAgreed,
  13. EMNotificationModelStatusDeclined,
  14. EMNotificationModelStatusExpired,
  15. };
  16. typedef NS_ENUM(NSInteger, EMNotificationModelType) {
  17. EMNotificationModelTypeContact = 0,
  18. EMNotificationModelTypeGroupInvite,
  19. EMNotificationModelTypeGroupJoin,
  20. };
  21. @interface EMNotificationModel : NSObject <NSCoding>
  22. @property (nonatomic, strong) NSString *sender;
  23. @property (nonatomic, strong) NSString *receiver;
  24. @property (nonatomic, strong) NSString *groupId;
  25. @property (nonatomic, strong) NSString *message;
  26. @property (nonatomic, strong) NSString *time;
  27. @property (nonatomic) EMNotificationModelStatus status;
  28. @property (nonatomic) EMNotificationModelType type;
  29. @property (nonatomic) BOOL isRead;
  30. @end
  31. @protocol EMNotificationsDelegate;
  32. @class EMMulticastDelegate;
  33. @interface EMNotificationHelper : NSObject <EMMultiDevicesDelegate, EMContactManagerDelegate, EMGroupManagerDelegate>
  34. @property (nonatomic, strong, readonly) NSString *fileName;
  35. @property (nonatomic, strong) NSMutableArray *notificationList;
  36. @property (nonatomic) BOOL isCheckUnreadCount;
  37. @property (nonatomic, readonly) NSInteger unreadCount;
  38. + (instancetype)shared;
  39. - (void)addDelegate:(id<EMNotificationsDelegate>)aDelegate;
  40. - (void)removeDelegate:(id<EMNotificationsDelegate>)aDelegate;
  41. //- (void)insertModel:(EMNotificationModel *)aModel;
  42. - (void)markAllAsRead;
  43. //- (NSInteger)getUnreadCount;
  44. - (void)archive;
  45. @end
  46. @protocol EMNotificationsDelegate <NSObject>
  47. @optional
  48. - (void)didNotificationsUpdate;
  49. - (void)didNotificationsUnreadCountUpdate:(NSInteger)aUnreadCount;
  50. @end
  51. NS_ASSUME_NONNULL_END