From ceb7e50f0c021739ded94e8b926040b701031090 Mon Sep 17 00:00:00 2001 From: Worthing ~ <115107835+w-goog@users.noreply.github.com> Date: Tue, 21 Jul 2026 15:28:00 -0700 Subject: [PATCH 1/3] Add Swift-specific argument label for resumeExternalUserAgentFlow(_:error:). Fixes #964 --- Examples/Example-iOS_Swift-SPM/Example/AppDelegate.swift | 2 +- Sources/AppAuthCore/OIDExternalUserAgentSession.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/Example-iOS_Swift-SPM/Example/AppDelegate.swift b/Examples/Example-iOS_Swift-SPM/Example/AppDelegate.swift index adb459ee9..ff1f50e2a 100644 --- a/Examples/Example-iOS_Swift-SPM/Example/AppDelegate.swift +++ b/Examples/Example-iOS_Swift-SPM/Example/AppDelegate.swift @@ -29,7 +29,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { // such as no pending flow, which previously surfaced as an NSException. if let authorizationFlow = self.currentAuthorizationFlow { do { - try authorizationFlow.resumeExternalUserAgentFlow(with: url) + try authorizationFlow.resumeExternalUserAgentFlow?(url) self.currentAuthorizationFlow = nil return true } catch { diff --git a/Sources/AppAuthCore/OIDExternalUserAgentSession.h b/Sources/AppAuthCore/OIDExternalUserAgentSession.h index 608f918a4..67ddbc071 100644 --- a/Sources/AppAuthCore/OIDExternalUserAgentSession.h +++ b/Sources/AppAuthCore/OIDExternalUserAgentSession.h @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN NO if the URL did not match (\@c OIDErrorCodeURLMismatch) or no authorization flow was pending (\@c OIDErrorCodeInvalidAuthorizationFlow). */ -- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL error:(NSError *_Nullable *_Nullable)error; +- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL error:(NSError *_Nullable *_Nullable)error NS_SWIFT_NAME(resumeExternalUserAgentFlow(_:)); @required /*! @brief @c OIDExternalUserAgent or clients should call this method when the From 95d99edb0de2dc278e0cd6b36e47138e431ed659 Mon Sep 17 00:00:00 2001 From: Worthing ~ <115107835+w-goog@users.noreply.github.com> Date: Tue, 21 Jul 2026 15:47:49 -0700 Subject: [PATCH 2/3] Add Swift-specific hint + update Changelog --- CHANGELOG.md | 3 +++ Sources/AppAuthCore/OIDExternalUserAgentSession.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbdf4c663..e7aa510ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Unreleased +- Add Swift name to `resumeExternalUserAgentFlowWithURL:error:` and update hint. (#966) + # 2.1.0 - Add SwiftUI + Swift Package Manager sample app under `Examples/Example-iOS_Swift-SPM`. ([#952](https://github.com/openid/AppAuth-iOS/pull/952)) - Removed external browser (Safari) fallback from `OIDExternalUserAgentIOS`. If `ASWebAuthenticationSession` fails to start (e.g., Guided Access is enabled), the authorization flow now fails with an error instead of opening an external browser. ([#954](https://github.com/openid/AppAuth-iOS/pull/954)) diff --git a/Sources/AppAuthCore/OIDExternalUserAgentSession.h b/Sources/AppAuthCore/OIDExternalUserAgentSession.h index 67ddbc071..8e92393f4 100644 --- a/Sources/AppAuthCore/OIDExternalUserAgentSession.h +++ b/Sources/AppAuthCore/OIDExternalUserAgentSession.h @@ -51,7 +51,9 @@ NS_ASSUME_NONNULL_BEGIN @remarks Has no effect if called more than once, or after a @c cancel message was received. @return YES if the passed URL matches the expected redirect URL and was consumed, NO otherwise. */ -- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL __deprecated_msg("Use resumeExternalUserAgentFlowWithURL:error: instead"); +- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL + __deprecated_msg("Use resumeExternalUserAgentFlowWithURL:error: instead. " + "Swift: Use the throwing resumeExternalUserAgentFlow(_:)"); @optional /*! @brief Clients should call this method with the result of the external user-agent code flow if From 0ded869201187c8ca22cec1335f32b58c3fd0fdd Mon Sep 17 00:00:00 2001 From: Worthing ~ <115107835+w-goog@users.noreply.github.com> Date: Thu, 23 Jul 2026 13:10:02 -0700 Subject: [PATCH 3/3] Update Swift Carthage example as well. --- Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift b/Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift index e530753fb..8e623d2f4 100644 --- a/Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift +++ b/Examples/Example-iOS_Swift-Carthage/Source/AppDelegate.swift @@ -37,7 +37,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // such as no pending flow, which previously surfaced as an NSException. if let authorizationFlow = self.currentAuthorizationFlow { do { - try authorizationFlow.resumeExternalUserAgentFlow(with: url) + try authorizationFlow.resumeExternalUserAgentFlow?(with: url) self.currentAuthorizationFlow = nil return true } catch {