Skip to content

Commit c81325e

Browse files
committed
chore: more accurate way of detecting swift app delegate
1 parent e191d65 commit c81325e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/expo-plugins/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
withAppDelegate,
77
withInfoPlist,
88
withMainApplication,
9+
IOSConfig,
910
} from '@expo/config-plugins';
1011

1112
import {
@@ -92,7 +93,7 @@ const withIntercomAndroid: ConfigPlugin<IntercomPluginProps> = (
9293
const appDelegate: ConfigPlugin<IntercomPluginProps> = (_config, props) =>
9394
withAppDelegate(_config, (config) => {
9495
let stringContents = config.modResults.contents;
95-
const swiftAppDelegate = config.modResults.contents.includes('import React');
96+
const swiftAppDelegate = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot).language==="swift"
9697
stringContents = swiftAppDelegate ? addImports(stringContents, ['Intercom'],false) : addObjcImports(stringContents, ['<IntercomModule.h>']);
9798

9899
// Remove previous code

0 commit comments

Comments
 (0)