You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Swift importer generates unusable signature for resumeExternalUserAgentFlow(with:error:) #964
Describe the bug
After the addition of resumeExternalUserAgentFlowWithURL:error: in PR #955, the new API appears to be imported incorrectly into Swift.
Passing nil or an NSError pointer is not possible, producing errors such as:
'nil' is not compatible with expected argument type '()'
As a result, the new API is effectively unusable from Swift, while the deprecated overload still works.
Screenshots
Environment
AppAuth 2.1.0
Xcode 26.6
iOS 26.5
Suggested fix
Any of:
Make resumeExternalUserAgentFlowWithURL:error: @required (major bump if needed), or
Keep @optional for ObjC but add a Swift overlay / NS_SWIFT_NAME so the documented throwing API is real, or
Update README + Swift examples to stop showing try …(with:) until Swift can call the new method, and document the ObjC-only / wrapper path
Happy to help test a patch.
Hi, I ran into the same issue, hence I was taking a look here. The fix in #966 looks good but there's one more thing I'd like to request.
The new delegate method -[OIDExternalUserAgentSession resumeExternalUserAgentFlowWithURL:error:] is marked as @optional, but I would argue that it should be a required method.
Having it be optional indicates to me that a certain User Agent Session may or may not implement it. This is not true, as it is the only replacement for the deprecated -[OIDExternalUserAgentSession resumeExternalUserAgentFlowWithURL:] method. Also, resuming the session after authentication is the happy path that should always be possible. An certain Session class should not be able to skip its implementation.
The call site also becomes a little bit awkward in Swift with the question mark and having to unwrap the result boolean.
Making the new method required does break source compatibility and therefore a major version bump must be done according to SemVer. This was probably your reason to make it optional in the first place. But I think a major version bump is the better option here.
"This was probably your reason to make it optional in the first place. But I think a major version bump is the better option here."
Indeed, that is the reason - to give our clients time to migrate :) In the next major release, we'll change the deprecation to no longer be a warning, and make the optional method required.
Activity
w-goog commentedon Jul 21, 2026
Thank you so much for the report, Oleksandr! I've put up a PR to fix & we'll release it as a patch :)
mbernson commentedon Jul 22, 2026
Hi, I ran into the same issue, hence I was taking a look here. The fix in #966 looks good but there's one more thing I'd like to request.
The new delegate method
-[OIDExternalUserAgentSession resumeExternalUserAgentFlowWithURL:error:]is marked as@optional, but I would argue that it should be a required method.Having it be optional indicates to me that a certain User Agent Session may or may not implement it. This is not true, as it is the only replacement for the deprecated
-[OIDExternalUserAgentSession resumeExternalUserAgentFlowWithURL:]method. Also, resuming the session after authentication is the happy path that should always be possible. An certain Session class should not be able to skip its implementation.The call site also becomes a little bit awkward in Swift with the question mark and having to unwrap the result boolean.
Making the new method required does break source compatibility and therefore a major version bump must be done according to SemVer. This was probably your reason to make it optional in the first place. But I think a major version bump is the better option here.
w-goog commentedon Jul 22, 2026
"This was probably your reason to make it optional in the first place. But I think a major version bump is the better option here."
Indeed, that is the reason - to give our clients time to migrate :) In the next major release, we'll change the deprecation to no longer be a warning, and make the optional method required.