Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .yarn/patches/expo-web-browser-npm-14.0.2-98d00ce880.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/ios/WebAuthSession.swift b/ios/WebAuthSession.swift
index 0d8101b01d7c6cd803acf6a359ceaa026993bdd0..c1beeabd962e561bf48392d58c084272247a95cc 100644
--- a/ios/WebAuthSession.swift
+++ b/ios/WebAuthSession.swift
@@ -20,17 +20,34 @@ final internal class WebAuthSession {
private var presentationContextProvider = PresentationContextProvider()

init(authUrl: URL, redirectUrl: URL?, options: AuthSessionOptions) {
- self.authSession = ASWebAuthenticationSession(
- url: authUrl,
- callbackURLScheme: redirectUrl?.scheme,
- completionHandler: { callbackUrl, error in
- self.finish(with: [
- "type": callbackUrl != nil ? "success" : "cancel",
- "url": callbackUrl?.absoluteString,
- "error": error?.localizedDescription
- ])
- }
- )
+ let completionHandler: (URL?, Error?) -> Void = { callbackUrl, error in
+ self.finish(with: [
+ "type": callbackUrl != nil ? "success" : "cancel",
+ "url": callbackUrl?.absoluteString,
+ "error": error?.localizedDescription
+ ])
+ }
+
+ // iOS 17.4+/macOS 14.4+ supports HTTPS callbacks with host/path matching
+ if #available(iOS 17.4, macOS 14.4, *),
+ let redirectUrl,
+ redirectUrl.scheme?.lowercased() == "https",
+ let host = redirectUrl.host(percentEncoded: false),
+ !host.isEmpty {
+ let rawPath = redirectUrl.path
+ let path = (rawPath.isEmpty || rawPath == "/") ? "" : rawPath
+ self.authSession = ASWebAuthenticationSession(
+ url: authUrl,
+ callback: .https(host: host, path: path),
+ completionHandler: completionHandler
+ )
+ } else {
+ self.authSession = ASWebAuthenticationSession(
+ url: authUrl,
+ callbackURLScheme: redirectUrl?.scheme,
+ completionHandler: completionHandler
+ )
+ }
self.authSession?.prefersEphemeralWebBrowserSession = options.preferEphemeralSession
}

1 change: 1 addition & 0 deletions ios/MetaMask/MetaMask.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<string>applinks:metamask-alternate.app.link</string>
<string>applinks:link.metamask.io</string>
<string>applinks:link-test.metamask.io</string>
<string>webcredentials:link.metamask.io</string>
</array>
<key>com.apple.developer.in-app-payments</key>
<array>
Expand Down
1 change: 1 addition & 0 deletions ios/MetaMask/MetaMaskDebug.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<string>applinks:metamask-alternate.app.link</string>
<string>applinks:link.metamask.io</string>
<string>applinks:link-test.metamask.io</string>
<string>webcredentials:link.metamask.io</string>
</array>
<key>com.apple.developer.in-app-payments</key>
<array>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@
"@metamask/accounts-controller": "37.0.0",
"@metamask/core-backend": "^5.0.0",
"bn.js@npm:4.11.6": "4.12.3",
"bn.js@npm:5.2.1": "5.2.3"
"bn.js@npm:5.2.1": "5.2.3",
"expo-web-browser@npm:~14.0.2": "patch:expo-web-browser@npm%3A14.0.2#~/.yarn/patches/expo-web-browser-npm-14.0.2-98d00ce880.patch"
},
"dependencies": {
"@config-plugins/detox": "^9.0.0",
Expand Down
12 changes: 11 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29212,7 +29212,7 @@ __metadata:
languageName: node
linkType: hard

"expo-web-browser@npm:~14.0.2":
"expo-web-browser@npm:14.0.2":
version: 14.0.2
resolution: "expo-web-browser@npm:14.0.2"
peerDependencies:
Expand All @@ -29222,6 +29222,16 @@ __metadata:
languageName: node
linkType: hard

"expo-web-browser@patch:expo-web-browser@npm%3A14.0.2#~/.yarn/patches/expo-web-browser-npm-14.0.2-98d00ce880.patch":
version: 14.0.2
resolution: "expo-web-browser@patch:expo-web-browser@npm%3A14.0.2#~/.yarn/patches/expo-web-browser-npm-14.0.2-98d00ce880.patch::version=14.0.2&hash=158d79"
peerDependencies:
expo: "*"
react-native: "*"
checksum: 10/68989f3d82afed74782e67aa9106df73c76a817cea8f7dbee54206177efb7176962f050b421699cebeb87a0cf2acad501e2dcf9d1e94d487b3fde07c8c20dc99
languageName: node
linkType: hard

"expo@npm:~52.0.47":
version: 52.0.47
resolution: "expo@npm:52.0.47"
Expand Down
Loading