From 126c463eac87f7f778053cb709ed0afcb3c02342 Mon Sep 17 00:00:00 2001 From: Ulrich GIBERNE Date: Fri, 13 Dec 2024 09:17:32 -0400 Subject: [PATCH] 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);