react-native-moengage 10.3.0 → 11.0.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,11 @@
1
+ # 07-08-2024
2
+
3
+ ## 11.0.0
4
+ - iOS
5
+ - BugFix: Resolved the issue of tracking User Attribute TRUE/FALSE as 0/1.
6
+ - Pinned plugin dependency version
7
+ - MoEngage-iOS-SDK version updated to `9.18.1`.
8
+
1
9
  # 31-07-2024
2
10
 
3
11
  ## 10.3.0
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
15
15
  s.platforms = { :ios => "11.0", :tvos => "11.0" }
16
16
  s.source_files = 'iOS/MoEReactBridge/**/*.{h,m,mm}'
17
17
  s.dependency 'React'
18
- s.dependency 'MoEngagePluginBase','>= 4.10.0','< 4.11.0'
18
+ s.dependency 'MoEngagePluginBase','5.0.0'
19
19
  s.ios.dependency 'MoEngage-iOS-SDK/RichNotification'
20
20
 
21
21
  s.prepare_command = <<-CMD
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-moengage",
3
- "version": "10.3.0",
3
+ "version": "11.0.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
  "files": [
package/src/index.ts CHANGED
@@ -56,6 +56,7 @@ import MoEPushPayload from "../src/models/MoEPushPayload";
56
56
  import MoEInAppData from "../src/models/MoEInAppData";
57
57
  import { getUserDeletionData } from "../src/moeParser/MoEngagePayloadParser";
58
58
  import { MoEngageNudgePosition } from "../src/models/MoEngageNudgePosition";
59
+ import MoEAnalyticsConfig from "../src/models/MoEAnalyticsConfig";
59
60
  import { MoESupportedAttributes } from "./models/MoESupportedAttributes";
60
61
 
61
62
  const PLATFORM_IOS = "ios";
@@ -160,13 +161,7 @@ var ReactMoE = {
160
161
  initialize: function (appId: string, initConfig: MoEInitConfig = MoEInitConfig.defaultConfig()) {
161
162
  moeAppId = appId;
162
163
  MoEngageGlobalCache.updateInitConfig(initConfig);
163
- let payload: string = "";
164
- if (Platform.OS == PLATFORM_ANDROID) {
165
- payload = getInitConfigJson(appId, initConfig);
166
- } else if (Platform.OS == PLATFORM_IOS) {
167
- payload = getAppIdJson(appId);
168
- }
169
-
164
+ let payload: string = getInitConfigJson(appId, initConfig);
170
165
  MoEngageLogger.verbose("Initializing the MoEngage Plugin");
171
166
  MoEReactBridge.initialize(payload);
172
167
  },
@@ -746,6 +741,7 @@ export {
746
741
  MoEngageLogLevel,
747
742
  MoEngageLogger,
748
743
  MoEngageNudgePosition,
744
+ MoEAnalyticsConfig
749
745
  };
750
746
  export default ReactMoE;
751
747
 
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Config class for Analytics
3
+ * Note: This Config is only for iOS platform and is a no-operation method for other plaforms.
4
+ */
5
+
6
+ export default class MoEAnalyticsConfig {
7
+
8
+ shouldTrackUserAttributeBoolAsNumber: boolean;
9
+
10
+ /**
11
+ * Create an instance of {@link MoEAnalyticsConfig}
12
+ *
13
+ * @param shouldTrackUserAttributeBoolAsNumber true to track User attribute TRUE/FALSE as 0/1
14
+ */
15
+ constructor (shouldTrackUserAttributeBoolAsNumber: boolean) {
16
+ this.shouldTrackUserAttributeBoolAsNumber = shouldTrackUserAttributeBoolAsNumber;
17
+ }
18
+
19
+ /**
20
+ * Default Config for {@link MoEAnalyticsConfig}
21
+ */
22
+ static defaultConfig() {
23
+ return new MoEAnalyticsConfig(false);
24
+ }
25
+ }
@@ -1,9 +1,9 @@
1
1
  import MoEngageLogConfig from "./MoEngageLogConfig";
2
2
  import MoEPushConfig from "./MoEPushConfig";
3
+ import MoEAnalyticsConfig from "./MoEAnalyticsConfig"
3
4
 
4
5
  /**
5
6
  * Config class for MoEngage SDK
6
- * Note: This Config is only for Android platform and is a no-operation method for other plaforms.
7
7
  */
8
8
  export default class MoEInitConfig {
9
9
 
@@ -11,17 +11,22 @@ export default class MoEInitConfig {
11
11
 
12
12
  logConfig: MoEngageLogConfig = MoEngageLogConfig.defaultConfig();
13
13
 
14
+ analyticsConfig = MoEAnalyticsConfig.defaultConfig();
15
+
14
16
  /**
15
17
  * Create an instance of {@link MoEInitConfig}
16
18
  *
17
19
  * @param pushConfig instance of {@link MoEPushConfig}
18
20
  * @param logConfig instance of {@link MoEngageLogConfig}
21
+ * @param analyticsConfig instance of {@link MoEAnalyticsConfig}
19
22
  */
20
23
  constructor(pushConfig: MoEPushConfig = MoEPushConfig.defaultConfig(),
21
- logConfig: MoEngageLogConfig = MoEngageLogConfig.defaultConfig()
24
+ logConfig: MoEngageLogConfig = MoEngageLogConfig.defaultConfig(),
25
+ analyticsConfig: MoEAnalyticsConfig = MoEAnalyticsConfig.defaultConfig()
22
26
  ) {
23
27
  this.pushConfig = pushConfig;
24
28
  this.logConfig = logConfig;
29
+ this.analyticsConfig = analyticsConfig;
25
30
  }
26
31
 
27
32
  /**
@@ -30,7 +35,8 @@ export default class MoEInitConfig {
30
35
  static defaultConfig() {
31
36
  return new MoEInitConfig(
32
37
  MoEPushConfig.defaultConfig(),
33
- MoEngageLogConfig.defaultConfig()
38
+ MoEngageLogConfig.defaultConfig(),
39
+ MoEAnalyticsConfig.defaultConfig()
34
40
  );
35
41
  }
36
42
  }
@@ -266,6 +266,9 @@ export function getInitConfigJson(appId: String, initConfig: MoEInitConfig) {
266
266
  initConfig: {
267
267
  pushConfig: {
268
268
  shouldDeliverCallbackOnForegroundClick: initConfig.pushConfig.shouldDeliverCallbackOnForegroundClick
269
+ },
270
+ analyticsConfig: {
271
+ shouldTrackUserAttributeBooleanAsNumber: initConfig.analyticsConfig.shouldTrackUserAttributeBoolAsNumber
269
272
  }
270
273
  }
271
274
  }