onesignal-expo-plugin 2.0.1 → 2.0.2
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.
|
@@ -141,6 +141,10 @@ const withOneSignalXcodeProject = (config, props) => {
|
|
|
141
141
|
return (0, config_plugins_1.withXcodeProject)(config, newConfig => {
|
|
142
142
|
var _a, _b;
|
|
143
143
|
const xcodeProject = newConfig.modResults;
|
|
144
|
+
if (!!xcodeProject.pbxTargetByName(iosConstants_1.NSE_TARGET_NAME)) {
|
|
145
|
+
OneSignalLog_1.OneSignalLog.log(`${iosConstants_1.NSE_TARGET_NAME} already exists in project. Skipping...`);
|
|
146
|
+
return newConfig;
|
|
147
|
+
}
|
|
144
148
|
// Create new PBXGroup for the extension
|
|
145
149
|
const extGroup = xcodeProject.addPbxGroup([...iosConstants_1.NSE_EXT_FILES, iosConstants_1.NSE_SOURCE_FILE], iosConstants_1.NSE_TARGET_NAME, iosConstants_1.NSE_TARGET_NAME);
|
|
146
150
|
// Add the new PBXGroup to the top level group. This makes the
|
|
@@ -158,10 +162,6 @@ const withOneSignalXcodeProject = (config, props) => {
|
|
|
158
162
|
const projObjects = xcodeProject.hash.project.objects;
|
|
159
163
|
projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};
|
|
160
164
|
projObjects['PBXContainerItemProxy'] = projObjects['PBXTargetDependency'] || {};
|
|
161
|
-
if (!!xcodeProject.pbxTargetByName(iosConstants_1.NSE_TARGET_NAME)) {
|
|
162
|
-
OneSignalLog_1.OneSignalLog.log(`${iosConstants_1.NSE_TARGET_NAME} already exists in project. Skipping...`);
|
|
163
|
-
return newConfig;
|
|
164
|
-
}
|
|
165
165
|
// Add the NSE target
|
|
166
166
|
// This adds PBXTargetDependency and PBXContainerItemProxy for you
|
|
167
167
|
const nseTarget = xcodeProject.addTarget(iosConstants_1.NSE_TARGET_NAME, "app_extension", iosConstants_1.NSE_TARGET_NAME, `${(_a = config.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier}.${iosConstants_1.NSE_TARGET_NAME}`);
|
|
@@ -154,9 +154,14 @@ const withOneSignalXcodeProject: ConfigPlugin<OneSignalPluginProps> = (config, p
|
|
|
154
154
|
return withXcodeProject(config, newConfig => {
|
|
155
155
|
const xcodeProject = newConfig.modResults
|
|
156
156
|
|
|
157
|
+
if (!!xcodeProject.pbxTargetByName(NSE_TARGET_NAME)) {
|
|
158
|
+
OneSignalLog.log(`${NSE_TARGET_NAME} already exists in project. Skipping...`);
|
|
159
|
+
return newConfig;
|
|
160
|
+
}
|
|
161
|
+
|
|
157
162
|
// Create new PBXGroup for the extension
|
|
158
163
|
const extGroup = xcodeProject.addPbxGroup([...NSE_EXT_FILES, NSE_SOURCE_FILE], NSE_TARGET_NAME, NSE_TARGET_NAME);
|
|
159
|
-
|
|
164
|
+
|
|
160
165
|
// Add the new PBXGroup to the top level group. This makes the
|
|
161
166
|
// files / folder appear in the file explorer in Xcode.
|
|
162
167
|
const groups = xcodeProject.hash.project.objects["PBXGroup"];
|
|
@@ -174,11 +179,6 @@ const withOneSignalXcodeProject: ConfigPlugin<OneSignalPluginProps> = (config, p
|
|
|
174
179
|
projObjects['PBXTargetDependency'] = projObjects['PBXTargetDependency'] || {};
|
|
175
180
|
projObjects['PBXContainerItemProxy'] = projObjects['PBXTargetDependency'] || {};
|
|
176
181
|
|
|
177
|
-
if (!!xcodeProject.pbxTargetByName(NSE_TARGET_NAME)) {
|
|
178
|
-
OneSignalLog.log(`${NSE_TARGET_NAME} already exists in project. Skipping...`);
|
|
179
|
-
return newConfig;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
182
|
// Add the NSE target
|
|
183
183
|
// This adds PBXTargetDependency and PBXContainerItemProxy for you
|
|
184
184
|
const nseTarget = xcodeProject.addTarget(NSE_TARGET_NAME, "app_extension", NSE_TARGET_NAME, `${config.ios?.bundleIdentifier}.${NSE_TARGET_NAME}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "onesignal-expo-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "The OneSignal Expo plugin allows you to use OneSignal without leaving the managed workflow. Developed in collaboration with SweetGreen.",
|
|
5
5
|
"main": "./app.plugin.js",
|
|
6
6
|
"scripts": {
|