react-native-moengage 8.3.0 → 8.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 16-02-2023
2
+
3
+ ## 8.4.0
4
+ - iOS
5
+ - MoEngage-iOS-SDK version updated to `~>9.4.0`.
6
+
1
7
  # 09-02-2023
2
8
 
3
9
  ## 8.3.0
@@ -15,8 +15,8 @@ Pod::Spec.new do |s|
15
15
  s.platform = :ios, "10.0"
16
16
  s.source_files = 'iOS/MoEReactBridge/**/*.{h,m}'
17
17
  s.dependency 'React'
18
- s.dependency 'MoEngagePluginBase','>= 4.0.0','< 4.1.0'
19
- s.dependency 'MoEngageRichNotification','>= 7.2.0','< 7.3.0'
18
+ s.dependency 'MoEngagePluginBase','>= 4.1.0','< 4.2.0'
19
+ s.dependency 'MoEngageRichNotification','>= 7.4.0','< 7.5.0'
20
20
 
21
21
  s.prepare_command = <<-CMD
22
22
  echo // Generated file, do not edit > iOS/MoEReactBridge/MoEngageReactPluginInfo.h
@@ -9,6 +9,7 @@
9
9
  #import "MoEngageReactPluginInfo.h"
10
10
  #import "MoEngageReactConstants.h"
11
11
  #import "MoEReactBridge.h"
12
+ #import "MoEngageReactUtils.h"
12
13
  #import <MoEngageSDK/MoEngageSDK.h>
13
14
  #import <MoEngageObjCUtils/MoEngageObjCUtils.h>
14
15
  @import MoEngagePluginBase;
@@ -100,19 +101,19 @@
100
101
  }
101
102
 
102
103
  if ([moeDict objectForKey:kDisablePeriodicFlush] != nil && [moeDict objectForKey:kDisablePeriodicFlush] != [NSNull null]) {
103
- sdkConfig.analyticsDisablePeriodicFlush = [moeDict getBooleanForKey:kDisablePeriodicFlush];
104
+ sdkConfig.analyticsDisablePeriodicFlush = [MoEngageReactUtils getBooleanForKey:kDisablePeriodicFlush dict:moeDict];
104
105
  }
105
106
 
106
107
  if ([moeDict objectForKey:kPeriodicFlushDuration] != nil && [moeDict objectForKey:kPeriodicFlushDuration] != [NSNull null]) {
107
- sdkConfig.analyticsPeriodicFlushDuration = [moeDict getIntegerForKey:kPeriodicFlushDuration];
108
+ sdkConfig.analyticsPeriodicFlushDuration = [MoEngageReactUtils getIntegerForKey:kPeriodicFlushDuration dict:moeDict];
108
109
  }
109
110
 
110
111
  if ([moeDict objectForKey:kEncryptNetworkRequests] != nil && [moeDict objectForKey:kEncryptNetworkRequests] != [NSNull null]) {
111
- sdkConfig.encryptNetworkRequests = [moeDict getBooleanForKey:kDisablePeriodicFlush];
112
+ sdkConfig.encryptNetworkRequests = [MoEngageReactUtils getBooleanForKey:kEncryptNetworkRequests dict:moeDict];
112
113
  }
113
114
 
114
115
  if ([moeDict objectForKey:kEnableLogs] != nil && [moeDict objectForKey:kEnableLogs] != [NSNull null]) {
115
- sdkConfig.enableLogs = [moeDict getBooleanForKey:kEnableLogs];
116
+ sdkConfig.enableLogs = [MoEngageReactUtils getBooleanForKey:kEnableLogs dict:moeDict];
116
117
  }
117
118
  }
118
119
 
@@ -0,0 +1,14 @@
1
+ //
2
+ // MoEngageReactUtils.h
3
+ // Pods
4
+ //
5
+ // Created by Rakshitha on 14/02/23.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <UIKit/UIKit.h>
10
+
11
+ @interface MoEngageReactUtils : NSObject
12
+ +(NSInteger)getIntegerForKey:(NSString *)key dict:(NSDictionary*)dict;
13
+ +(BOOL)getBooleanForKey:(NSString *)key dict:(NSDictionary*)dict;
14
+ @end
@@ -0,0 +1,40 @@
1
+ //
2
+ // MoEngageReactUtils.m
3
+ // CocoaAsyncSocket
4
+ //
5
+ // Created by Rakshitha on 14/02/23.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import "MoEngageReactUtils.h"
10
+
11
+ @implementation MoEngageReactUtils
12
+ +(NSInteger)getIntegerForKey:(NSString *)key dict:(NSDictionary*)dict {
13
+
14
+ NSString *value = [self stringForkey:key dict:dict];
15
+ if (value == NULL) {
16
+ return -1;
17
+ }
18
+ return [value integerValue];
19
+ }
20
+
21
+ +(NSString * __nullable)stringForkey:(NSString *)key dict:(NSDictionary*)dict {
22
+ if (key == NULL || key.length == 0) {
23
+ return NULL;
24
+ }
25
+ id value = [dict objectForKey:key];
26
+ if (value) {
27
+ return [NSString stringWithFormat:@"%@", value];
28
+ }
29
+ return NULL;
30
+ }
31
+
32
+ +(BOOL)getBooleanForKey:(NSString *)key dict:(NSDictionary*)dict {
33
+
34
+ NSString *value = [self stringForkey:key dict:dict];
35
+ if (value == NULL) {
36
+ return NO;
37
+ }
38
+ return [value boolValue];
39
+ }
40
+ @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-moengage",
3
- "version": "8.3.0",
3
+ "version": "8.4.0",
4
4
  "description": "MoEngage is a mobile marketing automation company. This react-native SDK helps you track events, trigger smart notifications and in-apps, provides a drop-in Inbox Controller for notifications.",
5
5
  "main": "src/index.ts",
6
6
  "keywords": [