NTESSDKConfigDelegate.m 921 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // NTESSDKConfig.m
  3. // NIM
  4. //
  5. // Created by amao on 5/9/16.
  6. // Copyright © 2016 Netease. All rights reserved.
  7. //
  8. #import "NTESSDKConfigDelegate.h"
  9. #import "NTESBundleSetting.h"
  10. @implementation NTESSDKConfigDelegate
  11. - (BOOL)shouldIgnoreNotification:(NIMNotificationObject *)notification
  12. {
  13. BOOL ignore = NO;
  14. NIMNotificationContent *content = notification.content;
  15. if ([content isKindOfClass:[NIMTeamNotificationContent class]]) //这里做个示范如何忽略部分通知 (不在聊天界面显示)
  16. {
  17. NSArray *types = [[NTESBundleSetting sharedConfig] ignoreTeamNotificationTypes];
  18. NIMTeamOperationType type = [(NIMTeamNotificationContent *)content operationType];
  19. for (NSString *item in types)
  20. {
  21. if (type == [item integerValue])
  22. {
  23. ignore = YES;
  24. break;
  25. }
  26. }
  27. }
  28. return ignore;
  29. }
  30. @end