I am quite surprise I can't fine any more or less clear explanation of how exactly the logic with callbackURLScheme (incl. completionHandler) works.
Yes, in general, it's kind of clear that it has something with the url schema, which can be specified in plist file, and the way Deep Linking works.
However,
how exactly it is bound to the ASWebAuthenticationSession/SFAuthenticationSession flow? I mean, does it looks for similar pattern in the browser url and if it becomes equals, it intercepts the response, closes the browser window and returns access to the app?
what if don't have the url schema defined, but I am just using Associated Domains? Should I specify the "return" url passed to the server, or there should be the schema anyways?
what if I pass null for it? There are some notes over the Internet, that in some magical way it get's bound to plist file, but, again, no particular documentation about that.
Really appreciate the answers!