Skip to content

Commit e191d65

Browse files
committed
feat: change appDelegate intercom import to support swift
1 parent 095b38f commit e191d65

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
@@ -92,7 +92,8 @@ const withIntercomAndroid: ConfigPlugin<IntercomPluginProps> = (
9292
const appDelegate: ConfigPlugin<IntercomPluginProps> = (_config, props) =>
9393
withAppDelegate(_config, (config) => {
9494
let stringContents = config.modResults.contents;
95-
stringContents = addObjcImports(stringContents, ['<IntercomModule.h>']);
95+
const swiftAppDelegate = config.modResults.contents.includes('import React');
96+
stringContents = swiftAppDelegate ? addImports(stringContents, ['Intercom'],false) : addObjcImports(stringContents, ['<IntercomModule.h>']);
9697

9798
// Remove previous code
9899
stringContents = stringContents.replace(

0 commit comments

Comments
 (0)