Loading...
Loading...
The Quiltt iOS SDK provides Components for seamless integration of the Quiltt Connector into your iOS app.
For full documentation, additional examples and the source code, see Quiltt iOS SDK on GitHub.
File > Add Package Dependency....Add Package.import QuilttConnector.Quiltt always prioritizes OAuth-based connections, which require your user to provide consent on their institution's website or app, and then be redirected back to your app. This means that your application needs to be able to gracefully handle this redirect by returning them to the Connector flow in your app.
For production Environments, you must always pass a https:// URL to appLauncherUrl. This URL must be a valid Universal Link that can launch your app, like https://app.mydomain.com/connect_bank.
Please see the iOS Universal Links guide for more information.
For local development, you can use http://. We recommend using a tunneling service like Ngrok.
https://*.callback.quiltt.ioAfter importing QuilttConnector, you can use its classes and methods in your code. Here's a basic example:
import SwiftUI
import QuilttConnector
import WebKit
struct ConnectorView: View {
@Binding var showHomeView: Bool
@Binding var connectionId: String
var body: some View {
WebView(showHomeView: $showHomeView, connectionId: $connectionId)
}
}
struct WebView: UIViewRepresentable {
@Binding var showHomeView: Bool
@Binding var connectionId: String
@State var config = QuilttConnectorConnectConfiguration(
connectorId: "<CONNECTOR_ID>",
institution: "<OPTIONAL_INSTITUTION_SEARCH_TERM_TO_PREFILL_INSTITUTION>",
appLauncherUrl: "<YOUR_HTTPS_UNIVERSAL_LINK>"
)
func makeUIView(context: Context) -> WKWebView {
// Initialize QuilttConnector
let quilttConnector = QuilttConnector.init()
// Authenticate the Connector
// See https://www.quiltt.dev/authentication/issuing-session-tokens
quilttConnector.authenticate(token: "<SESSION_TOKEN_FROM_SERVER>")
// Launch the Connector
let webview = quilttConnector.connect(config: config,
onEvent: { eventType, metadata in
print("onEvent \(eventType), \(metadata)")
},
onExitSuccess: { metadata in
print("onExitSuccess \(metadata)")
if let newConnectionId = metadata.connectionId {
connectionId = newConnectionId
}
showHomeView = true
},
onExitAbort: { metadata in
print("onExitAbort \(metadata)")
showHomeView = true
},
onExitError: { metadata in
print("onExitError \(metadata)")
showHomeView = true
})
return webview
}
func updateUIView(_ uiView: WKWebView, context: Context) {
// Use this method to update the WKWebView with new configuration settings.
}
}
#Preview {
ConnectorView(showHomeView: .constant(false), connectionId: .constant("connectionId"))
}