Skip to content

Commit e184ac4

Browse files
committed
[Expo][iOS] Fix Swift AppDelegate plugin for @main annotation (Expo SDK 55+)
Expo SDK 55 adopted Swift 6, changing AppDelegate.swift from @UIApplicationMain to @main. The config plugin used /@UIApplicationMain/ as a regex anchor to inject `import TSBackgroundFetch`, which silently fails on SDK 55+. Update the regex to /@(UIApplication)?main/ so it matches both @UIApplicationMain (SDK 53-54) and @main (SDK 55+).
1 parent 3be7d95 commit e184ac4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

expo/plugin/src/iOSPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const modifySwiftAppDelegate = (src:string) => {
6666
tag: "react-native-background-fetch-import",
6767
src,
6868
newSrc: "import TSBackgroundFetch",
69-
anchor: /@UIApplicationMain/,
69+
anchor: /@(UIApplication)?main/,
7070
offset: -1,
7171
comment: "//",
7272
}).contents;

0 commit comments

Comments
 (0)