Connect iOS SDK
The Connect iOS SDK allows you to embed our Finicity Connect application anywhere you want within your own mobile applications.
Compatibility
- Supports iOS 11 or later
Install the SDK
CocoaPods
To install the SDK include the following in your Podfile.
use_frameworks!
pod 'FinicityConnect'
- Open your project in Xcode and drag the Connect.xcframework folder into your project.
- In the build settings for the target folder, select the General tab.
- Scroll down to the Frameworks, Libraries, and Embedded Content section, and select Connect.xcframework.
- Under the Embed column, select Embed & Sign from the menu drop-down list if it’s not already selected.
Create Callback Functions
Create callback functions for loaded, done, cancel, and error events. These callbacks correspond to events in Connect’s data flow.
func connectLoaded() {
self.connectNavController = UINavigationController(rootViewController: self.connectViewController)
self.connectNavController.modalPresentationStyle = .fullScreen
self.present(self.connectNavController, animated: false)
}
loaded | Called when the Connect web page is loaded and ready to display. |
done | Called when the user successfully completes the Connect application. It also has an unlabeled NSDictionary? parameter containing event information. |
cancel | Called when the user cancels the Connect application. |
error | Called when an error occurs while the user is using the Connect application. The unlabeled NSDictionary? parameter contains event information. |
route | Called with the user is navigating through the screens of the Connect application. The unlabeled NSDictionary? parameter containing event information. |
user | Connect 2.0 (only) Called when a user performs an action. User events provide visibility into what action a user could take within the Connect application. The unlabeled NSDictionary? parameter contains event information. |
Create a ConnectViewConfig Object and ConnectViewController Class
- 1.
Using a valid Connect URL and callback functions, create a ConnectViewConfig object.
See Generate 2.0 Connect URL Links. - 2.
Create an instance of the ConnectViewController class, providing the ConnectViewConfig class when calling its load method.
- 3.
In the loaded callback, present the ConnectViewController using a UINavigationController with the ConnectViewcontroller as its rootViewController.
- 4.
The ConnectViewController automatically dismisses when the Connect flow is completed, canceled early by the user, or when an error occurred.
- 5.
See also: ViewController.swift
func openConnect(url: String) {
let config = ConnectViewConfig(connectUrl: url, loaded: self.connectLoaded, done: self.connectDone, cancel: self.connectCancelled, error: self.connectError, route: self.connectRoute, userEvent: self.connectUserEvent)
self.connectViewController = ConnectViewController()
self.connectViewController.load(config: config)
}
func connectLoaded() {
self.connectNavController = UINavigationController(rootViewController: self.connectViewController)
self.connectNavController.modalPresentationStyle = .fullScreen
self.present(self.connectNavController, animated: false)
}
func connectDone(_ data: NSDictionary?) {
// Connect flow completed
}
func connectCancelled() {
// Connect flow exited prematurely
}
func connectError(_ data: NSDictionary?) {
// Error encountered in Connect flow
}
func connectRoute(_data: NSDictionary?) {
// Connect route changed
}
func connectUserEvent(_ data: NSDictionary?) {
// Connect user event fired in response to user action
}
Migrate From Framework to XCFramework
The iOS SDK uses the XCFramework format which allows you to more easily integrate our SDK into your development projects. Our iOS SDK has full bitcode support so that you don’t have to disable bitcode in your applications when integrating with our SDK.
The XCFramework format is Apple’s officially supported format for distributing binary libraries for multiple platforms and architectures in a single bundle.
Unlike framework, the XCFramework doesn’t require you to strip out the simulator X86 binary library from your bundle before submitting your apps to the Apple App Store.
Step 1—Delete Connect.framework from your project
If you’re currently using framework in your projects, then you need to remove it before you start using the XCFramework. This ensures that the connect.framework won’t interfere with the new XCFramework while you’re trying to compile your source code.
Caution: Before deleting your existing framework, test the new XCFramework, and make sure it is working correctly so that you don’t accidentally delete your source files.
- Download the Connect iOS SDK.
- Go to https://github.com/Finicity/connect-ios-sdk
- Click Code, and then Download zip.
- Unzip the file.
- Open your project in Xcode.
- Click the General tab.
- Scroll down to the Frameworks, Libraries, and Embedded Content section.
- Select connect.framework.
- To delete the framework, click (–) minus.
Step 2—Remove the Connect.framework reference
- From Project Navigator on the left pane, select framework and press Delete.
- Click Remove Reference (recommended)
Note: This is the safest option to preserve your source files.
Step 3—Remove run script
If you’ve incorporated our script for stripping out the X86 simulator before submitting your application to the Apple App Store, you can remove the run script. It’s no longer needed with the XCFramework.
Note: Only customers that created a run script to incorporate with the connect-sdk-iOS-v1.2.0.zip need to do this step.
- From Xcode in the right pane, select your Targets.
- On the Build Phase tab, scroll down to Run Script.
- To remove the script, click the x.