Since iOS SDK 14.5 (Xcode 12.5) ASWebAuthenticationSession instantiation might crash with exception:
NSInvalidArgumentException: The provided scheme is not valid. A scheme should not include special characters such as ":" or "/".
The solution would be to use: callBackURI.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) before passing it to callbackURLScheme.
I see that currently URL.scheme is being passed to callbackURLScheme and it should not include ':' or '/', but may be it would be nice to add encoding to future-proof code changes to some extend?
Hello,
Since iOS SDK 14.5 (Xcode 12.5) ASWebAuthenticationSession instantiation might crash with exception:
The solution would be to use:
callBackURI.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)
before passing it to callbackURLScheme.I see that currently
URL.scheme
is being passed to callbackURLScheme and it should not include ':' or '/', but may be it would be nice to add encoding to future-proof code changes to some extend?More info here: https://developer.apple.com/forums/thread/679251
Thanks!