react-native-expo-moengage 1.1.1 → 1.2.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 +10 -0
- package/android/build.gradle +1 -1
- package/build/apple/constants.js +3 -1
- package/build/apple/withDangerousMod.js +20 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
- package/src/apple/constants.ts +2 -0
- package/src/apple/withDangerousMod.ts +24 -1
- package/src/index.ts +1 -0
- package/src/types.ts +6 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -10,7 +10,7 @@ buildscript {
|
|
|
10
10
|
|
|
11
11
|
dependencies {
|
|
12
12
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
|
13
|
-
classpath "com.moengage.android.hybrid.module.config.plugin:com.moengage.android.hybrid.module.config.plugin.gradle.plugin:0.0.
|
|
13
|
+
classpath "com.moengage.android.hybrid.module.config.plugin:com.moengage.android.hybrid.module.config.plugin.gradle.plugin:0.0.5"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
package/build/apple/constants.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* including target names, file lists, and pod dependencies.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MOENGAGE_IOS_LIVE_ACTIVITY_POD = exports.MOENGAGE_IOS_DEVICE_TRIGGER_POD = exports.MOENGAGE_IOS_PUSH_TEMPLATE_POD = exports.MOENGAGE_IOS_NOTIFICATION_SERVICE_POD = exports.MOENGAGE_IOS_PUSH_TEMPLATE_FILES = exports.MOENGAGE_IOS_RICH_PUSH_FILES = exports.MOENGAGE_IOS_LIVE_ACTIVITY_TARGET = exports.MOENGAGE_IOS_PUSH_TEMPLATE_TARGET = exports.MOENGAGE_IOS_RICH_PUSH_TARGET = void 0;
|
|
9
|
+
exports.MOENGAGE_IOS_LIVE_ACTIVITY_POD = exports.MOENGAGE_IOS_DEVICE_TRIGGER_POD = exports.MOENGAGE_IOS_PUSH_TEMPLATE_POD = exports.MOENGAGE_IOS_NOTIFICATION_SERVICE_POD = exports.MOENGAGE_IOS_COCOAPODS_SOURCE = exports.MOENGAGE_IOS_PODSPEC_SOURCE = exports.MOENGAGE_IOS_PUSH_TEMPLATE_FILES = exports.MOENGAGE_IOS_RICH_PUSH_FILES = exports.MOENGAGE_IOS_LIVE_ACTIVITY_TARGET = exports.MOENGAGE_IOS_PUSH_TEMPLATE_TARGET = exports.MOENGAGE_IOS_RICH_PUSH_TARGET = void 0;
|
|
10
10
|
/**
|
|
11
11
|
* Target names for the extension targets in Xcode
|
|
12
12
|
* These names are used when creating extension targets in the Xcode project
|
|
@@ -41,6 +41,8 @@ exports.MOENGAGE_IOS_PUSH_TEMPLATE_FILES = [
|
|
|
41
41
|
* These pod specifications are added to the Podfile for each target
|
|
42
42
|
* that requires the functionality
|
|
43
43
|
*/
|
|
44
|
+
exports.MOENGAGE_IOS_PODSPEC_SOURCE = 'https://github.com/moengage/PodSpecs.git'; // Custom MoEngage CocoaPods specs source
|
|
45
|
+
exports.MOENGAGE_IOS_COCOAPODS_SOURCE = 'https://github.com/CocoaPods/Specs.git'; // Default CocoaPods specs source
|
|
44
46
|
exports.MOENGAGE_IOS_NOTIFICATION_SERVICE_POD = 'MoEngage-iOS-SDK/RichNotification'; // For Rich Push Notification Service Extension
|
|
45
47
|
exports.MOENGAGE_IOS_PUSH_TEMPLATE_POD = 'MoEngage-iOS-SDK/RichNotification'; // For Push Templates Notification Content Extension
|
|
46
48
|
exports.MOENGAGE_IOS_DEVICE_TRIGGER_POD = 'MoEngage-iOS-SDK/RealTimeTrigger'; // For Device-based campaign triggers
|
|
@@ -89,6 +89,26 @@ const withMoEngageDangerousMod = (config, props) => {
|
|
|
89
89
|
console.error(message);
|
|
90
90
|
throw new Error(message);
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Add custom CocoaPods specs source if not already present
|
|
94
|
+
*
|
|
95
|
+
* MoEngage pods are hosted on a custom specs repository. If the Podfile
|
|
96
|
+
* doesn't already include this source, we prepend both the MoEngage specs
|
|
97
|
+
* source and the default CocoaPods specs source to ensure proper resolution.
|
|
98
|
+
*/
|
|
99
|
+
const podfilePath = path.join(projectRoot, 'ios', 'Podfile');
|
|
100
|
+
if (apple.addCustomPodspecSource && fs.existsSync(podfilePath)) {
|
|
101
|
+
let podfile = fs.readFileSync(podfilePath, 'utf8');
|
|
102
|
+
if (!podfile.includes(constants_1.MOENGAGE_IOS_PODSPEC_SOURCE)) {
|
|
103
|
+
const sources = [`source '${constants_1.MOENGAGE_IOS_PODSPEC_SOURCE}'`];
|
|
104
|
+
if (!podfile.includes(constants_1.MOENGAGE_IOS_COCOAPODS_SOURCE)) {
|
|
105
|
+
sources.push(`source '${constants_1.MOENGAGE_IOS_COCOAPODS_SOURCE}'`);
|
|
106
|
+
}
|
|
107
|
+
sources.push('');
|
|
108
|
+
podfile = sources.join('\n') + podfile;
|
|
109
|
+
fs.writeFileSync(podfilePath, podfile);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
92
112
|
/**
|
|
93
113
|
* Set up the Rich Push Notification Service Extension
|
|
94
114
|
*
|
package/build/index.js
CHANGED
package/package.json
CHANGED
package/src/apple/constants.ts
CHANGED
|
@@ -42,6 +42,8 @@ export const MOENGAGE_IOS_PUSH_TEMPLATE_FILES = [
|
|
|
42
42
|
* These pod specifications are added to the Podfile for each target
|
|
43
43
|
* that requires the functionality
|
|
44
44
|
*/
|
|
45
|
+
export const MOENGAGE_IOS_PODSPEC_SOURCE = 'https://github.com/moengage/PodSpecs.git'; // Custom MoEngage CocoaPods specs source
|
|
46
|
+
export const MOENGAGE_IOS_COCOAPODS_SOURCE = 'https://github.com/CocoaPods/Specs.git'; // Default CocoaPods specs source
|
|
45
47
|
export const MOENGAGE_IOS_NOTIFICATION_SERVICE_POD = 'MoEngage-iOS-SDK/RichNotification'; // For Rich Push Notification Service Extension
|
|
46
48
|
export const MOENGAGE_IOS_PUSH_TEMPLATE_POD = 'MoEngage-iOS-SDK/RichNotification'; // For Push Templates Notification Content Extension
|
|
47
49
|
export const MOENGAGE_IOS_DEVICE_TRIGGER_POD = 'MoEngage-iOS-SDK/RealTimeTrigger'; // For Device-based campaign triggers
|
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
MOENGAGE_IOS_NOTIFICATION_SERVICE_POD,
|
|
12
12
|
MOENGAGE_IOS_PUSH_TEMPLATE_POD,
|
|
13
13
|
MOENGAGE_IOS_DEVICE_TRIGGER_POD,
|
|
14
|
-
MOENGAGE_IOS_LIVE_ACTIVITY_POD
|
|
14
|
+
MOENGAGE_IOS_LIVE_ACTIVITY_POD,
|
|
15
|
+
MOENGAGE_IOS_PODSPEC_SOURCE,
|
|
16
|
+
MOENGAGE_IOS_COCOAPODS_SOURCE
|
|
15
17
|
} from './constants';
|
|
16
18
|
|
|
17
19
|
const plist = require('plist');
|
|
@@ -66,6 +68,27 @@ export const withMoEngageDangerousMod: ConfigPlugin<MoEngagePluginProps> = (conf
|
|
|
66
68
|
throw new Error(message);
|
|
67
69
|
}
|
|
68
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Add custom CocoaPods specs source if not already present
|
|
73
|
+
*
|
|
74
|
+
* MoEngage pods are hosted on a custom specs repository. If the Podfile
|
|
75
|
+
* doesn't already include this source, we prepend both the MoEngage specs
|
|
76
|
+
* source and the default CocoaPods specs source to ensure proper resolution.
|
|
77
|
+
*/
|
|
78
|
+
const podfilePath = path.join(projectRoot, 'ios', 'Podfile');
|
|
79
|
+
if (apple.addCustomPodspecSource && fs.existsSync(podfilePath)) {
|
|
80
|
+
let podfile = fs.readFileSync(podfilePath, 'utf8');
|
|
81
|
+
if (!podfile.includes(MOENGAGE_IOS_PODSPEC_SOURCE)) {
|
|
82
|
+
const sources: string[] = [`source '${MOENGAGE_IOS_PODSPEC_SOURCE}'`];
|
|
83
|
+
if (!podfile.includes(MOENGAGE_IOS_COCOAPODS_SOURCE)) {
|
|
84
|
+
sources.push(`source '${MOENGAGE_IOS_COCOAPODS_SOURCE}'`);
|
|
85
|
+
}
|
|
86
|
+
sources.push('');
|
|
87
|
+
podfile = sources.join('\n') + podfile;
|
|
88
|
+
fs.writeFileSync(podfilePath, podfile);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
69
92
|
/**
|
|
70
93
|
* Set up the Rich Push Notification Service Extension
|
|
71
94
|
*
|
package/src/index.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -78,6 +78,12 @@ export interface MoEngageIosConfig {
|
|
|
78
78
|
*/
|
|
79
79
|
deviceTriggerEnabled: boolean;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Whether to add custom MoEngage CocoaPods specs source to the Podfile
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
addCustomPodspecSource: boolean;
|
|
86
|
+
|
|
81
87
|
/**
|
|
82
88
|
* Path to the Live Activity target
|
|
83
89
|
*/
|