1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// An object used to evaluate navigation events in an authentication session. When the session navigates
/// to a matching URL, it will pass the URL to the session completion handler.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsessioncallback?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ASWebAuthenticationSessionCallback;
);
unsafe impl Send for ASWebAuthenticationSessionCallback {}
unsafe impl Sync for ASWebAuthenticationSessionCallback {}
extern_conformance!(
unsafe impl NSObjectProtocol for ASWebAuthenticationSessionCallback {}
);
impl ASWebAuthenticationSessionCallback {
extern_methods!(
/// Creates a callback object that matches against URLs with the given custom scheme.
///
/// Parameter `customScheme`: The custom scheme that the app expects in the callback URL.
#[unsafe(method(callbackWithCustomScheme:))]
#[unsafe(method_family = none)]
pub unsafe fn callbackWithCustomScheme(custom_scheme: &NSString) -> Retained<Self>;
/// Creates a callback object that matches against HTTPS URLs with the given host and path.
///
/// Parameter `host`: The host that the app expects in the callback URL. The host must be associated with the
/// app using associated web credentials domains.
///
/// Parameter `path`: The path that the app expects in the callback URL.
#[unsafe(method(callbackWithHTTPSHost:path:))]
#[unsafe(method_family = none)]
pub unsafe fn callbackWithHTTPSHost_path(
host: &NSString,
path: &NSString,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
/// Check whether a given main-frame navigation URL matches the callback expected by the client app. Handles all URL-based callback strategies, including custom schemes and HTTPS navigations.
/// This is mainly meant for web browsers adopting the ASWebAuthenticationWebBrowser API, but may also be useful for other apps for debugging purposes.
///
/// Parameter `url`: The URL to check.
#[unsafe(method(matchesURL:))]
#[unsafe(method_family = none)]
pub unsafe fn matchesURL(&self, url: &NSURL) -> bool;
);
}