Skip to content

Swift importer generates unusable signature for resumeExternalUserAgentFlow(with:error:) #964

Description

@oleksandrtatarchuk

Describe the bug
After the addition of resumeExternalUserAgentFlowWithURL:error: in PR #955, the new API appears to be imported incorrectly into Swift.

The Objective-C declaration is:

- (BOOL)resumeExternalUserAgentFlowWithURL:(NSURL *)URL
                                     error:(NSError *_Nullable *_Nullable)error;

However, Swift resolves the method as if the second parameter has type (), resulting in autocomplete like:

flow.resumeExternalUserAgentFlow?(with: url, error: ())

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

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriageIssues that need to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions