I am trying to create a connected account with Stripe, after requesting an account ID from the API it spits out a URL to handle the auth, I am using ASWebAuthenticationSession, it looks like this:
// this is the return url I have given stripe
// https://www.brandboost.app/auth-completion
// some api calls...then stripe returns a url to handle auth that looks like this:
// https://connect.stripe.com/setup/e/acct_1NNfeWPM94892HW/xjaxXiCRPS
let authSession = ASWebAuthenticationSession(url: url, callbackURLScheme: "auth-completion") { (url, error) in
//
}
Once the auth is complete, Stripe redirects to the return URL. How can I make my return URL trigger the callback scheme/completion?
The completion closure is only called when using URL schemes (the old way of doing deep links). If you use universal links (the new way), you will receive a callback as with any universal link. As described here: https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app The completion closure is not called for universal links. This could be more clear in Apples documentation.
In my experience URL schemes work more reliable with ASWebAuthenticationSession. And they are secure when used with ASWebAuthenticationSession as Apple guarantees that even if there are several apps subscribing to the same scheme, your app will receive the callback.