diff --git a/CHANGELOG.md b/CHANGELOG.md index a9c07ca36..82a5e312b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # UNRELEASED +- Add Swift name to `resumeExternalUserAgentFlowWithURL:error:` and update hint. (#966) - Replace case range with explicit case labels in OIDTokenUtilities. Addresses issue #947. ([#963](https://github.com/openid/AppAuth-iOS/pull/963)) # 2.1.0 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 { 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..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 @@ -71,7 +73,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