Installation

  1. If you haven’t already, install the latest version of CocoaPods.
  2. If you don’t have an existing Podfile, run the following command to create one:
pod init
  1. Add this line to your Podfile
pod 'FuseConnect', '~> 1.0.2'
  1. Run the following command
pod install
  1. To update to newer releases in the future, run:
pod install

Opening Fuse Connection

Starting the Fuse Connect for iOS experience begins with creating a token. Once the token is passed to your app, show the select bank screen by passing the token to the WebViewController. Note that each time you open Link, you will need to get a new token from your server.

import FuseConnect

let fuseConnectController = FuseConnectViewController(clientSecret: "CLIENT_SECRET_FROM_SERVER")
{ _ in
    // Handle events
} onSuccess: { linkSuccess in
    // Handle success
} onInstitutionSelected: { institutionSelect in
    // Handle institution selection
} onExit: { exit in
    // Handle exit 
}

fuseConnectController.modalPresentationStyle = .fullScreen
viewController.present(fuseConnectController, animated: true, completion: nil)

Method parameters

FieldTypeRequiredDescription
clientSecretStringYesA string representing the generated client secret. This secret is used to authenticate the API and grant access to bank data. See /session
onInstitutionSelectedFunctionYesA required closure that is called when a user selects an institution to link. The closure should expect a single argument:

InstitutionSelect - Which contains:
- Institution_id - Represents the unique identifier for the selected bank.
- callback - Receives the link token generated by the backend. See /link/token for how to generate a link token.
onSuccessFunctionYesA closure that is called when the user successfully connects their bank account. The closure should expect a single argument:

LinkSuccess - Which contains
- A temporary token that can be exchanged for an access token to access the user's bank data. See /financial_connections/public_token/exchange
onExitFunctionYesA closure function that is called when the user exits Link without successfully linking an item or when an error occurs during Link initialization. The closure should expect a single argument:

exit - Which contains:
- err - An error object, if an error occurred during the connection process.
- metadata - contains additional information about the connection, such as the bank name and institution ID.
onEventFunctionYesA callback function that is called when an event occurs during the connection process.