diff --git a/src/expo-plugins/index.ts b/src/expo-plugins/index.ts index 979293df..13616ecc 100644 --- a/src/expo-plugins/index.ts +++ b/src/expo-plugins/index.ts @@ -6,6 +6,7 @@ import { withAppDelegate, withInfoPlist, withMainApplication, + IOSConfig, } from '@expo/config-plugins'; import { @@ -92,7 +93,12 @@ const withIntercomAndroid: ConfigPlugin = ( const appDelegate: ConfigPlugin = (_config, props) => withAppDelegate(_config, (config) => { let stringContents = config.modResults.contents; - stringContents = addObjcImports(stringContents, ['']); + const swiftAppDelegate = + IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot).language === + 'swift'; + stringContents = swiftAppDelegate + ? addImports(stringContents, ['Intercom'], false) + : addObjcImports(stringContents, ['']); // Remove previous code stringContents = stringContents.replace(