Contents

https(host:path:)

Creates a callback object that matches against HTTPS URLs with the given host and path.

Declaration

class func https(host: String, path: String) -> Self

Parameters

  • host:

    The host that the app requires in the callback URL. The host must be a member of a domain associated with the app, as described in Supporting Associated Domains.

  • path:

    The path that the app requires in the callback URL.

Discussion

The following example creates a session that requires a callback with an https:// URL:

let session = ASWebAuthenticationSession(
    url: URL(string: "https://example.com/oauth/login/authorize")!,
    callback: .https(host: "auth.example.com", path: "/auth/callback/example")
) { callbackURL, error in
    // Handle the session result.
}

See Also

Creating callbacks