iOS
Requirements: iOS 15+, Swift 5.9+, Xcode 15+. Source and issues: github.com/vrsoai/verso-connect-ios.Install
Swift Package Manager. In Xcode: File › Add Package Dependencies, enterhttps://github.com/vrsoai/verso-connect-ios, dependency rule “Up to Next Major Version” from 0.1.0. Or in Package.swift:
Use
Your backend signs a connect link withsignLink() exactly as for the web (purpose: "connect") and returns its url to the app. The app secret never ships in the app. Collect the user’s consent in your own UI before this point, as with the hosted page.
VersoConnect.present(link:from:completion:), exists for code that is not async.
present opens a sheet with the provider’s login, waits for the user to log in, captures the session and dismisses the sheet itself in every case. It returns the connectionId; your backend receives connection.created with the user’s userRef at the same time, exactly as with the hosted page, and the first sync starts within a minute.
The link is single use and valid 15 minutes: fetch a fresh one each time the user taps your button. The login itself must complete within one hour.
Errors
What the SDK does
- Sends the link’s token to
POST /api/connect-nativewithaction: "start". Verso verifies and consumes the link, creates the user record if needed, sendsconnect.started, and answers with the provider’s login URL, the name of the session cookie to watch, and a one-time capture credential. - Opens the provider’s login in a
WKWebViewwith a non-persistent data store and the Mobile Safari user agent, so the provider treats it as a browser. Nothing remains on the device afterwards. - Watches the WebView’s cookies. Once the session cookie is present and the session is usable, sends it to Verso with
action: "capture". Verso encrypts the credential with a key that exists only for this connection, creates the connection, folds a previous connection of the same account into it (Reconnecting), refuses an account already connected by another user of your app, sendsconnection.createdand starts the first sync.