OfflinePushExtConfigInfo.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // OfflinePushExtConfigInfo.m
  3. // TUICore
  4. //
  5. // Created by cologne on 2024/3/19.
  6. // Copyright © 2024 Tencent. All rights reserved.
  7. #import "OfflinePushExtConfigInfo.h"
  8. @implementation OfflinePushExtConfigInfo
  9. - (instancetype)init {
  10. self = [super init];
  11. if (self) {
  12. [self setupData];
  13. }
  14. return self;
  15. }
  16. - (void)setupData {
  17. self.fcmPushType = 0;
  18. self.fcmNotificationType = 0;
  19. }
  20. - (void)configWithTIMPushFeaturesDic:(NSDictionary *)featuresDic {
  21. if (featuresDic == nil || ![featuresDic isKindOfClass:NSDictionary.class]) {
  22. return ;
  23. }
  24. if ([featuresDic.allKeys containsObject:@"fcmPushType"]) {
  25. int fcmPushType = 0;
  26. fcmPushType = [featuresDic[@"fcmPushType"] integerValue];
  27. self.fcmPushType = fcmPushType;
  28. }
  29. if ([featuresDic.allKeys containsObject:@"fcmNotificationType"]) {
  30. int fcmNotificationType = 0;
  31. fcmNotificationType = [featuresDic[@"fcmNotificationType"] integerValue];
  32. self.fcmNotificationType = fcmNotificationType;
  33. }
  34. }
  35. - (NSDictionary *)toReportData {
  36. NSMutableDictionary *dict = [NSMutableDictionary dictionary];
  37. dict[@"fcmPushType"] = @(self.fcmPushType);
  38. dict[@"fcmNotificationType"] = @(self.fcmNotificationType);
  39. return dict;
  40. }
  41. @end