Skip to content

Commit e6c3b54

Browse files
committed
feat: support linking in Expo
1 parent 1d201cf commit e6c3b54

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

packages/react-native-brownfield/ios/ExpoHostRuntime.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,25 @@ final class ExpoHostRuntime {
9696
) != nil
9797
}
9898

99+
// Linking API; method code courtesy of Expo, licensed under the MIT License - https://github.com/expo/expo/blob/main/apps/bare-expo/ios/AppDelegate.swift
100+
public override func application(
101+
_ app: UIApplication,
102+
open url: URL,
103+
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
104+
) -> Bool {
105+
return super.application(app, open: url, options: options) || RCTLinkingManager.application(app, open: url, options: options)
106+
}
107+
108+
// Universal Links; method code courtesy of Expo, licensed under the MIT License - https://github.com/expo/expo/blob/main/apps/bare-expo/ios/AppDelegate.swift
109+
public override func application(
110+
_ application: UIApplication,
111+
continue userActivity: NSUserActivity,
112+
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
113+
) -> Bool {
114+
let result = RCTLinkingManager.application(application, continue: userActivity, restorationHandler: restorationHandler)
115+
return super.application(application, continue: userActivity, restorationHandler: restorationHandler) || result
116+
}
117+
99118
func view(
100119
moduleName: String,
101120
initialProps: [AnyHashable: Any]?,

0 commit comments

Comments
 (0)