From 8f7668b060fdd7da946a69f027323345d613c23d Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Thu, 12 Dec 2024 15:50:48 -0400 Subject: [PATCH 1/8] add devTeam and default service extension --- .../AirshipNotificationService.swift | 8 ++++++++ plugin/src/withAirship.ts | 6 +++++- plugin/src/withAirshipIOS.ts | 10 ++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 plugin/NotificationServiceExtension/AirshipNotificationService.swift diff --git a/plugin/NotificationServiceExtension/AirshipNotificationService.swift b/plugin/NotificationServiceExtension/AirshipNotificationService.swift new file mode 100644 index 0000000..1b5ec9b --- /dev/null +++ b/plugin/NotificationServiceExtension/AirshipNotificationService.swift @@ -0,0 +1,8 @@ +// NotificationService.swift + + +import AirshipServiceExtension + +class AirshipNotificationService: UANotificationServiceExtension { + +} diff --git a/plugin/src/withAirship.ts b/plugin/src/withAirship.ts index 5fd6977..390b530 100644 --- a/plugin/src/withAirship.ts +++ b/plugin/src/withAirship.ts @@ -25,12 +25,16 @@ export type AirshipIOSPluginProps = { /** * Optional. The local path to a custom Notification Service Extension. */ - notificationService?: string; + notificationService?: 'DEFAULT_AIRSHIP_SERVICE_EXTENSION' | string; /** * Optional. Airship will use a default one if not provided. * The local path to a Notification Service Extension Info.plist. */ notificationServiceInfo?: string; + /** + * Optional. The Apple Development Team ID used to configure the Notification Service Extension target. + */ + developmentTeamID?: string; } export type AirshipPluginProps = { diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 0831475..70b63dd 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -62,9 +62,10 @@ async function writeNotificationServiceFilesAsync(props: AirshipIOSPluginProps, } // Copy the NotificationService.swift file into the iOS expo project as AirshipNotificationService.swift. - readFile(props.notificationService, 'utf8', (err, data) => { + var notificationServiceFile = props.notificationService == "DEFAULT_AIRSHIP_SERVICE_EXTENSION" ? join(sourceDir, NOTIFICATION_SERVICE_FILE_NAME) : props.notificationService; + readFile(notificationServiceFile, 'utf8', (err, data) => { if (err || !data) { - console.error("Airship couldn't read file " + props.notificationService); + console.error("Airship couldn't read file " + notificationServiceFile); console.error(err); return; } @@ -160,9 +161,14 @@ const withExtensionTargetInXcodeProject: ConfigPlugin = ( const buildSettingsObj = configurations[key].buildSettings; buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = "14.0"; buildSettingsObj.SWIFT_VERSION = "5.0"; + buildSettingsObj.DEVELOPMENT_TEAM = props?.developmentTeamID; + buildSettingsObj.CODE_SIGN_STYLE = "Automatic"; } } + // Add development teams to the target + xcodeProject.addTargetAttribute("DevelopmentTeam", props?.developmentTeamID, notificationServiceExtensionTarget); + return newConfig; }); }; From fb7c877c9e936518ab981e4417e7635d272a7140 Mon Sep 17 00:00:00 2001 From: Ryan Lepinski Date: Thu, 12 Dec 2024 14:35:39 -0800 Subject: [PATCH 2/8] Make targetName configurable --- plugin/src/withAirship.ts | 4 ++++ plugin/src/withAirshipIOS.ts | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/plugin/src/withAirship.ts b/plugin/src/withAirship.ts index 390b530..a062b86 100644 --- a/plugin/src/withAirship.ts +++ b/plugin/src/withAirship.ts @@ -31,6 +31,10 @@ export type AirshipIOSPluginProps = { * The local path to a Notification Service Extension Info.plist. */ notificationServiceInfo?: string; + /** + * Optional. Defaults to NotificationServiceExtension if not provided. + */ + notificationServiceTargetName?: string; /** * Optional. The Apple Development Team ID used to configure the Notification Service Extension target. */ diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 70b63dd..fd19b96 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -13,7 +13,7 @@ import { basename, join } from 'path'; import { AirshipIOSPluginProps } from './withAirship'; import { mergeContents, MergeResults } from '@expo/config-plugins/build/utils/generateCode'; -const NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME = "AirshipNotificationServiceExtension"; +const DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME = "NotificationServiceExtension"; const NOTIFICATION_SERVICE_FILE_NAME = "AirshipNotificationService.swift"; const NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME = "AirshipNotificationServiceExtension-Info.plist"; @@ -54,8 +54,8 @@ async function writeNotificationServiceFilesAsync(props: AirshipIOSPluginProps, const pluginDir = require.resolve("airship-expo-plugin/package.json"); const sourceDir = join(pluginDir, "../plugin/NotificationServiceExtension/"); - - const extensionPath = join(projectRoot, "ios", NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME); + const targetName = props.notificationServiceTargetName ?? DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + const extensionPath = join(projectRoot, "ios", targetName); if (!existsSync(extensionPath)) { mkdirSync(extensionPath, { recursive: true }); @@ -91,19 +91,20 @@ async function writeNotificationServiceFilesAsync(props: AirshipIOSPluginProps, }; const withExtensionTargetInXcodeProject: ConfigPlugin = (config, props) => { + const targetName = props.notificationServiceTargetName ?? DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + return withXcodeProject(config, newConfig => { const xcodeProject = newConfig.modResults; - - if (!!xcodeProject.pbxTargetByName(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME)) { - console.log(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + " already exists in project. Skipping..."); + if (!!xcodeProject.pbxTargetByName(targetName)) { + console.log(targetName + " already exists in project. Skipping..."); return newConfig; } // Create new PBXGroup for the extension const extGroup = xcodeProject.addPbxGroup( [NOTIFICATION_SERVICE_FILE_NAME, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME], - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + targetName, + targetName ); // Add the new PBXGroup to the top level group. This makes the @@ -126,10 +127,10 @@ const withExtensionTargetInXcodeProject: ConfigPlugin = ( // Add the Notification Service Extension Target // This adds PBXTargetDependency and PBXContainerItemProxy const notificationServiceExtensionTarget = xcodeProject.addTarget( - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, + targetName, "app_extension", - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, - `${config.ios?.bundleIdentifier}.${NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}` + targetName, + `${config.ios?.bundleIdentifier}.${targetName}` ); // Add build phases to the new Target @@ -156,7 +157,7 @@ const withExtensionTargetInXcodeProject: ConfigPlugin = ( const configurations = xcodeProject.pbxXCBuildConfigurationSection(); for (const key in configurations) { if (typeof configurations[key].buildSettings !== "undefined" - && configurations[key].buildSettings.PRODUCT_NAME == `"${NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}"` + && configurations[key].buildSettings.PRODUCT_NAME == `"${targetName}"` ) { const buildSettingsObj = configurations[key].buildSettings; buildSettingsObj.IPHONEOS_DEPLOYMENT_TARGET = "14.0"; @@ -174,9 +175,11 @@ const withExtensionTargetInXcodeProject: ConfigPlugin = ( }; const withAirshipServiceExtensionPod: ConfigPlugin = (config, props) => { + const targetName = props.notificationServiceTargetName ?? DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + return withPodfile(config, async (config) => { const airshipServiceExtensionPodfileSnippet = ` - target '${NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}' do + target '${targetName}' do use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks'] use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS'] pod 'AirshipServiceExtension' From 738b3ec047abccdb14611aa0d4ede1671ccfba01 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 09:15:44 -0400 Subject: [PATCH 3/8] add the target to eas config extra --- plugin/src/withAirshipIOS.ts | 100 +++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 70b63dd..35d988f 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -9,6 +9,9 @@ import { import { readFile, writeFileSync, existsSync, mkdirSync } from 'fs'; import { basename, join } from 'path'; +import assert from 'assert'; + +import { ExpoConfig } from '@expo/config-types'; import { AirshipIOSPluginProps } from './withAirship'; import { mergeContents, MergeResults } from '@expo/config-plugins/build/utils/generateCode'; @@ -17,6 +20,8 @@ const NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME = "AirshipNotificationServiceEx const NOTIFICATION_SERVICE_FILE_NAME = "AirshipNotificationService.swift"; const NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME = "AirshipNotificationServiceExtension-Info.plist"; +const AIRSHP_PLUGIN_EXTENDER_DIR_NAME = "AirshipPluginExtender"; + const withCapabilities: ConfigPlugin = (config, props) => { return withInfoPlist(config, (plist) => { if (!Array.isArray(plist.modResults.UIBackgroundModes)) { @@ -210,6 +215,100 @@ const withAirshipServiceExtensionPod: ConfigPlugin = (con }); }; +const withEasManagedCredentials: ConfigPlugin = (config) => { + assert(config.ios?.bundleIdentifier, "Missing 'ios.bundleIdentifier' in app config.") + config.extra = getEasManagedCredentialsConfigExtra(config as ExpoConfig); + return config; +} + +function getEasManagedCredentialsConfigExtra(config: ExpoConfig): {[k: string]: any} { + return { + ...config.extra, + eas: { + ...config.extra?.eas, + build: { + ...config.extra?.eas?.build, + experimental: { + ...config.extra?.eas?.build?.experimental, + ios: { + ...config.extra?.eas?.build?.experimental?.ios, + appExtensions: [ + ...(config.extra?.eas?.build?.experimental?.ios?.appExtensions ?? []), + { + // Sync up with the new target + targetName: NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, + bundleIdentifier: `${config?.ios?.bundleIdentifier}.${NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}`, + } + ] + } + } + } + } + } +} + +const withAirshipExtender: ConfigPlugin = (config, props) => { + return withDangerousMod(config, [ + 'ios', + async config => { + await writeAirshipExtenderFileAsync(props, config.modRequest.projectRoot); + return config; + }, + ]); +}; + +async function writeAirshipExtenderFileAsync(props: AirshipIOSPluginProps, projectRoot: string) { + if (!props.airshipExtender) { + return; + } + + const fileName = basename(props.airshipExtender) + const extenderDestinationPath = join(projectRoot, "ios", AIRSHP_PLUGIN_EXTENDER_DIR_NAME); + + if (!existsSync(extenderDestinationPath)) { + mkdirSync(extenderDestinationPath, { recursive: true }); + } + + // Copy the Airship Extender file into the iOS expo project. + readFile(props.airshipExtender, 'utf8', (err, data) => { + if (err || !data) { + console.error("Airship couldn't read file " + (props.airshipExtender)); + console.error(err); + return; + } + writeFileSync(join(extenderDestinationPath, fileName), data); + }); +}; + +const withAirshipExtenderInMainTarget: ConfigPlugin = (config, props) => { + return withXcodeProject(config, newConfig => { + const xcodeProject = newConfig.modResults; + + if (!!xcodeProject.pbxTargetByName(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME)) { + console.log(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + " already exists in project. Skipping..."); + return newConfig; + } + + // Create new PBXGroup for the extension + const extGroup = xcodeProject.addPbxGroup( + [NOTIFICATION_SERVICE_FILE_NAME, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME], + NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, + NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + ); + + // Add the new PBXGroup to the top level group. This makes the + // files / folder appear in the file explorer in Xcode. + const groups = xcodeProject.hash.project.objects["PBXGroup"]; + Object.keys(groups).forEach(function(key) { + if (typeof groups[key] === "object" && groups[key].name === undefined && groups[key].path === undefined) { + xcodeProject.addToPbxGroup(extGroup.uuid, key); + } + }); + + return newConfig; + }); +}; + export const withAirshipIOS: ConfigPlugin = (config, props) => { config = withCapabilities(config, props); config = withAPNSEnvironment(config, props); @@ -217,6 +316,7 @@ export const withAirshipIOS: ConfigPlugin = (config, prop config = withNotificationServiceExtension(config, props); config = withExtensionTargetInXcodeProject(config, props); config = withAirshipServiceExtensionPod(config, props); + config = withEasManagedCredentials(config, props); } return config; }; \ No newline at end of file From 126c463eac87f7f778053cb709ed0afcb3c02342 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 09:17:32 -0400 Subject: [PATCH 4/8] remove extra things added --- plugin/src/withAirshipIOS.ts | 64 ------------------------------------ 1 file changed, 64 deletions(-) diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 35d988f..2806ab8 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -20,8 +20,6 @@ const NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME = "AirshipNotificationServiceEx const NOTIFICATION_SERVICE_FILE_NAME = "AirshipNotificationService.swift"; const NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME = "AirshipNotificationServiceExtension-Info.plist"; -const AIRSHP_PLUGIN_EXTENDER_DIR_NAME = "AirshipPluginExtender"; - const withCapabilities: ConfigPlugin = (config, props) => { return withInfoPlist(config, (plist) => { if (!Array.isArray(plist.modResults.UIBackgroundModes)) { @@ -247,68 +245,6 @@ function getEasManagedCredentialsConfigExtra(config: ExpoConfig): {[k: string]: } } -const withAirshipExtender: ConfigPlugin = (config, props) => { - return withDangerousMod(config, [ - 'ios', - async config => { - await writeAirshipExtenderFileAsync(props, config.modRequest.projectRoot); - return config; - }, - ]); -}; - -async function writeAirshipExtenderFileAsync(props: AirshipIOSPluginProps, projectRoot: string) { - if (!props.airshipExtender) { - return; - } - - const fileName = basename(props.airshipExtender) - const extenderDestinationPath = join(projectRoot, "ios", AIRSHP_PLUGIN_EXTENDER_DIR_NAME); - - if (!existsSync(extenderDestinationPath)) { - mkdirSync(extenderDestinationPath, { recursive: true }); - } - - // Copy the Airship Extender file into the iOS expo project. - readFile(props.airshipExtender, 'utf8', (err, data) => { - if (err || !data) { - console.error("Airship couldn't read file " + (props.airshipExtender)); - console.error(err); - return; - } - writeFileSync(join(extenderDestinationPath, fileName), data); - }); -}; - -const withAirshipExtenderInMainTarget: ConfigPlugin = (config, props) => { - return withXcodeProject(config, newConfig => { - const xcodeProject = newConfig.modResults; - - if (!!xcodeProject.pbxTargetByName(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME)) { - console.log(NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME + " already exists in project. Skipping..."); - return newConfig; - } - - // Create new PBXGroup for the extension - const extGroup = xcodeProject.addPbxGroup( - [NOTIFICATION_SERVICE_FILE_NAME, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME], - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, - NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME - ); - - // Add the new PBXGroup to the top level group. This makes the - // files / folder appear in the file explorer in Xcode. - const groups = xcodeProject.hash.project.objects["PBXGroup"]; - Object.keys(groups).forEach(function(key) { - if (typeof groups[key] === "object" && groups[key].name === undefined && groups[key].path === undefined) { - xcodeProject.addToPbxGroup(extGroup.uuid, key); - } - }); - - return newConfig; - }); -}; - export const withAirshipIOS: ConfigPlugin = (config, props) => { config = withCapabilities(config, props); config = withAPNSEnvironment(config, props); From e12dda4205b5966242eda966e200d0975b70a888 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 12:44:46 -0400 Subject: [PATCH 5/8] fix extension renaming --- ...plist => NotificationServiceExtension-Info.plist} | 0 plugin/src/withAirshipIOS.ts | 12 ++++++------ 2 files changed, 6 insertions(+), 6 deletions(-) rename plugin/NotificationServiceExtension/{AirshipNotificationServiceExtension-Info.plist => NotificationServiceExtension-Info.plist} (100%) diff --git a/plugin/NotificationServiceExtension/AirshipNotificationServiceExtension-Info.plist b/plugin/NotificationServiceExtension/NotificationServiceExtension-Info.plist similarity index 100% rename from plugin/NotificationServiceExtension/AirshipNotificationServiceExtension-Info.plist rename to plugin/NotificationServiceExtension/NotificationServiceExtension-Info.plist diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 907bf3f..be4c412 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -18,7 +18,7 @@ import { mergeContents, MergeResults } from '@expo/config-plugins/build/utils/ge const DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME = "NotificationServiceExtension"; const NOTIFICATION_SERVICE_FILE_NAME = "AirshipNotificationService.swift"; -const NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME = "AirshipNotificationServiceExtension-Info.plist"; +const NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME = "NotificationServiceExtension-Info.plist"; const withCapabilities: ConfigPlugin = (config, props) => { return withInfoPlist(config, (plist) => { @@ -216,13 +216,13 @@ const withAirshipServiceExtensionPod: ConfigPlugin = (con }); }; -const withEasManagedCredentials: ConfigPlugin = (config) => { +const withEasManagedCredentials: ConfigPlugin = (config, props) => { assert(config.ios?.bundleIdentifier, "Missing 'ios.bundleIdentifier' in app config.") - config.extra = getEasManagedCredentialsConfigExtra(config as ExpoConfig); + config.extra = getEasManagedCredentialsConfigExtra(config as ExpoConfig, props); return config; } -function getEasManagedCredentialsConfigExtra(config: ExpoConfig): {[k: string]: any} { +function getEasManagedCredentialsConfigExtra(config: ExpoConfig, props: AirshipIOSPluginProps): {[k: string]: any} { return { ...config.extra, eas: { @@ -237,8 +237,8 @@ function getEasManagedCredentialsConfigExtra(config: ExpoConfig): {[k: string]: ...(config.extra?.eas?.build?.experimental?.ios?.appExtensions ?? []), { // Sync up with the new target - targetName: NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, - bundleIdentifier: `${config?.ios?.bundleIdentifier}.${NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}`, + targetName: props.notificationServiceTargetName ?? DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME, + bundleIdentifier: `${config?.ios?.bundleIdentifier}.${props.notificationServiceTargetName ?? DEFAULT_NOTIFICATION_SERVICE_EXTENSION_TARGET_NAME}`, } ] } From 5f43c3f79bb99c28dece14619401043235056145 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 13:07:12 -0400 Subject: [PATCH 6/8] rename Info.plist file in fonction of target name --- plugin/src/withAirshipIOS.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index be4c412..8c09907 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -89,7 +89,8 @@ async function writeNotificationServiceFilesAsync(props: AirshipIOSPluginProps, console.error(err); return; } - writeFileSync(join(extensionPath, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME), data); + const infoPlistFilename = props.notificationServiceTargetName ? props.notificationServiceTargetName + "-Info.plist" : NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME; + writeFileSync(join(extensionPath, infoPlistFilename), data); }); }; From 0a24ae9bc04a6c5fdfc726675c4a5c09e3668534 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 13:07:55 -0400 Subject: [PATCH 7/8] comment --- plugin/src/withAirshipIOS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 8c09907..89d5880 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -82,7 +82,7 @@ async function writeNotificationServiceFilesAsync(props: AirshipIOSPluginProps, writeFileSync(join(extensionPath, NOTIFICATION_SERVICE_FILE_NAME), data); }); - // Copy the Info.plist (default to AirshipNotificationServiceExtension-Info.plist if null) file into the iOS expo project as AirshipNotificationServiceExtension-Info.plist. + // Copy the Info.plist (default to NotificationServiceExtension-Info.plist if null) file into the iOS expo project. readFile(props.notificationServiceInfo ?? join(sourceDir, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME), 'utf8', (err, data) => { if (err || !data) { console.error("Airship couldn't read file " + (props.notificationServiceInfo ?? join(sourceDir, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME))); From 6ea9239bc4bc57bff574fdb47069b21189019aed Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 16:26:33 -0400 Subject: [PATCH 8/8] prepare 1.3.2-beta version --- CHANGELOG.md | 3 +++ package.json | 2 +- plugin/src/withAirshipIOS.ts | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a739d6..6776178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Airship Expo Plugin Changelog +## Version 1.3.2-beta - December 013, 2024 +Beta version that fixes the Notification Service Extension for EAS builds. + ## Version 1.3.1 - December 06, 2024 Patch version that fixes the support for Aiship Notification Service Extension when using `use_frameworks`. diff --git a/package.json b/package.json index 32fc3a4..9c2f98c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "airship-expo-plugin", - "version": "1.3.1", + "version": "1.3.2-beta", "description": "Airship Expo config plugin", "main": "./app.plugin.js", "scripts": { diff --git a/plugin/src/withAirshipIOS.ts b/plugin/src/withAirshipIOS.ts index 89d5880..dbefe10 100644 --- a/plugin/src/withAirshipIOS.ts +++ b/plugin/src/withAirshipIOS.ts @@ -104,9 +104,10 @@ const withExtensionTargetInXcodeProject: ConfigPlugin = ( return newConfig; } + const infoPlistFilename = props.notificationServiceTargetName ? props.notificationServiceTargetName + "-Info.plist" : NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME; // Create new PBXGroup for the extension const extGroup = xcodeProject.addPbxGroup( - [NOTIFICATION_SERVICE_FILE_NAME, NOTIFICATION_SERVICE_INFO_PLIST_FILE_NAME], + [NOTIFICATION_SERVICE_FILE_NAME, infoPlistFilename], targetName, targetName );