react-native-moengage 10.2.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 +21 -0
- package/ReactNativeMoEngage.podspec +2 -2
- package/android/build.gradle +6 -6
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/package.json +3 -3
- package/src/index.ts +4 -8
- package/src/models/MoEAnalyticsConfig.ts +25 -0
- package/src/models/MoEInitConfig.ts +9 -3
- package/src/moeParser/MoEInAppParser.ts +0 -3
- package/src/moeParser/MoEngagePayloadParser.ts +2 -2
- package/src/utils/MoEJsonBuilder.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
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
|
+
|
|
9
|
+
# 31-07-2024
|
|
10
|
+
|
|
11
|
+
## 10.3.0
|
|
12
|
+
- Fixing the typescript configuration warnings.
|
|
13
|
+
- Android
|
|
14
|
+
- `moe-android-sdk` version updated to `13.04.00`
|
|
15
|
+
- `inapp` version updated to `8.5.0`
|
|
16
|
+
- Added support for AGP `8.4.0` and above
|
|
17
|
+
- Kotlin version updated to `1.9.23`
|
|
18
|
+
- Compile SDK version updated to `34`
|
|
19
|
+
- iOS
|
|
20
|
+
- MoEngage-iOS-SDK version updated to `~>9.18.0`.
|
|
21
|
+
|
|
1
22
|
# 03-07-2024
|
|
2
23
|
|
|
3
24
|
## 10.2.0
|
|
@@ -15,8 +15,8 @@ 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','
|
|
19
|
-
s.ios.dependency '
|
|
18
|
+
s.dependency 'MoEngagePluginBase','5.0.0'
|
|
19
|
+
s.ios.dependency 'MoEngage-iOS-SDK/RichNotification'
|
|
20
20
|
|
|
21
21
|
s.prepare_command = <<-CMD
|
|
22
22
|
echo // Generated file, do not edit > iOS/MoEReactBridge/MoEngageReactPluginInfo.h
|
package/android/build.gradle
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
ext.kotlinVersion = '1.
|
|
2
|
+
ext.kotlinVersion = '1.9.23'
|
|
3
3
|
repositories {
|
|
4
4
|
google()
|
|
5
5
|
mavenCentral()
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
dependencies {
|
|
9
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
9
|
+
classpath 'com.android.tools.build:gradle:8.4.0'
|
|
10
10
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -20,12 +20,12 @@ rootProject.allprojects {
|
|
|
20
20
|
|
|
21
21
|
ext {
|
|
22
22
|
//dependency version
|
|
23
|
-
moengageCoreVersion = "13.
|
|
24
|
-
moengageInAppVersion = "8.
|
|
25
|
-
basePluginVersion = "4.0
|
|
23
|
+
moengageCoreVersion = "13.04.00"
|
|
24
|
+
moengageInAppVersion = "8.5.0"
|
|
25
|
+
basePluginVersion = "4.1.0"
|
|
26
26
|
//build versions
|
|
27
27
|
minimumVersion = 21
|
|
28
|
-
compileVersion =
|
|
28
|
+
compileVersion = 34
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
apply plugin: 'com.android.library'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#Thu Aug 18 13:23:11 IST 2022
|
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.
|
|
3
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
|
|
4
4
|
distributionPath=wrapper/dists
|
|
5
5
|
zipStorePath=wrapper/dists
|
|
6
6
|
zipStoreBase=GRADLE_USER_HOME
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-moengage",
|
|
3
|
-
"version": "
|
|
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": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"events"
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
|
-
"test": "echo \"
|
|
27
|
+
"test": "echo \"Test cases not available\" && exit 0"
|
|
28
28
|
},
|
|
29
29
|
"author": {
|
|
30
30
|
"name": "MoEngage",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"
|
|
38
|
+
"react-native": "0.73.0"
|
|
39
39
|
},
|
|
40
40
|
"codegenConfig": {
|
|
41
41
|
"name": "NativeMoEngageSpec",
|
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
|
},
|
|
@@ -721,7 +716,7 @@ var ReactMoE = {
|
|
|
721
716
|
try {
|
|
722
717
|
if (Platform.OS == PLATFORM_ANDROID) {
|
|
723
718
|
const deleteUserPayload = await MoEReactBridge.deleteUser(accountMetaJson);
|
|
724
|
-
return getUserDeletionData(deleteUserPayload);
|
|
719
|
+
return getUserDeletionData(deleteUserPayload as string);
|
|
725
720
|
} else {
|
|
726
721
|
MoEngageLogger.debug("This api is not supported on iOS platform.");
|
|
727
722
|
}
|
|
@@ -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
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import MoEngageLogger from "../logger/MoEngageLogger";
|
|
2
|
-
import MoEAccountMeta from "../models/MoEAccountMeta";
|
|
3
2
|
import MoECampaignContext from "../models/MoECampaignContext";
|
|
4
3
|
import MoECampaignData from "../models/MoECampaignData";
|
|
5
4
|
import MoEClickData from "../models/MoEClickData";
|
|
@@ -10,7 +9,6 @@ import MoESelfHandledCampaign from "../models/MoESelfHandledCampaign";
|
|
|
10
9
|
import MoESelfHandledCampaignData from "../models/MoESelfHandledCampaignData";
|
|
11
10
|
import {
|
|
12
11
|
ACTION_TYPE,
|
|
13
|
-
APP_ID,
|
|
14
12
|
FORMATTED_CAMPAIGN_ID,
|
|
15
13
|
MOE_CAMPAIGN_CONTEXT,
|
|
16
14
|
MOE_CAMPAIGN_ID,
|
|
@@ -26,7 +24,6 @@ import {
|
|
|
26
24
|
MOE_PAYLOAD,
|
|
27
25
|
MOE_PLATFORM,
|
|
28
26
|
MOE_SELF_HANDLED,
|
|
29
|
-
MOE_SELF_HANDLED_OBJ_ERROR,
|
|
30
27
|
MOE_NAVIGATION_VALUE
|
|
31
28
|
} from "../utils/MoEConstants";
|
|
32
29
|
import { isValidObject } from "../utils/MoEHelper";
|
|
@@ -33,11 +33,11 @@ export function getMoEAccountMeta(payload: { [k: string]: any }): MoEAccountMeta
|
|
|
33
33
|
/**
|
|
34
34
|
* Create an instance of {@link UserDeletionData} from json object
|
|
35
35
|
*
|
|
36
|
-
* @param payload - JSON Object with required key
|
|
36
|
+
* @param payload - stringified JSON Object with required key
|
|
37
37
|
* @returns instance of {@link UserDeletionData}
|
|
38
38
|
* @since 8.6.0
|
|
39
39
|
*/
|
|
40
|
-
export function getUserDeletionData(payload:
|
|
40
|
+
export function getUserDeletionData(payload: string): UserDeletionData {
|
|
41
41
|
const payloadJsonObject = JSON.parse(payload);
|
|
42
42
|
return new UserDeletionData(
|
|
43
43
|
getMoEAccountMeta(payloadJsonObject[ACCOUNT_META]),
|
|
@@ -8,6 +8,7 @@ import {MoEngagePermissionType} from "../models/MoEngagePermissionType";
|
|
|
8
8
|
import MoEInitConfig from "../models/MoEInitConfig";
|
|
9
9
|
import MoEngageLogger from "../logger/MoEngageLogger";
|
|
10
10
|
import {MoEngageNudgePosition} from "../models/MoEngageNudgePosition";
|
|
11
|
+
import { MoESupportedAttributes } from "../models/MoESupportedAttributes";
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
export function getInAppCampaignJson(moEInAppData: MoEInAppData, type: string, appId: String) {
|
|
@@ -265,6 +266,9 @@ export function getInitConfigJson(appId: String, initConfig: MoEInitConfig) {
|
|
|
265
266
|
initConfig: {
|
|
266
267
|
pushConfig: {
|
|
267
268
|
shouldDeliverCallbackOnForegroundClick: initConfig.pushConfig.shouldDeliverCallbackOnForegroundClick
|
|
269
|
+
},
|
|
270
|
+
analyticsConfig: {
|
|
271
|
+
shouldTrackUserAttributeBooleanAsNumber: initConfig.analyticsConfig.shouldTrackUserAttributeBoolAsNumber
|
|
268
272
|
}
|
|
269
273
|
}
|
|
270
274
|
}
|