Skip to main content

IOS SDK


Integration

The iOS SDK can be added either via Cocoapods or downloaded and added manually as an .xcframework. In addition to the example shown below, we have also made available a [sample application](https://github.com/Link-Money-Public/ios-sdk-sample-app) demonstrating how to integrate the SDK.

Podfile
pod 'LinkAccount', '~> 1'

Example

Example
1import LinkAccount
2
3let view = LinkAccountView(sessionKey: sessionKey, environment: .production)
4 view.display { result in
5	self.isPresenting.toggle()
6	switch result {
7	case .success(let value):
8		print("Customer ID is \(value)")
9	case .failure(let error):
10		print(error)
11	}
12}

Module

The LinkAccount module contains everything necessary to kick off the linking flow and debug issues resulting from failed linking attempts.

Members

LinkAccountView

This class is the entry point to linking bank accounts. To begin initiating bank account linking, you can call LinkAccountView instance and then call the display method.

Methods

LinkError

  • code

    string

    Error Code

  • message

    string

    Error message

  • errorDescription

    string

    Description of error

LinkEnvironment

  • production

    enum

    Enum type pointing to production

  • sandbox

    enum

    Enum type pointing to sandbox

LinkAccountComplete

LinkAccountComplete is a closure returning a Swift Result type with either .success or .failure set.

  • success

    string

    String value representing the customer ID

  • failure

    LinkError

    Encapsulates errors returned from account linking


LinkService

This class provides methods to retrieve customer info and lists of authorized accounts.

  • accessToken

    string

    Your access token

  • environment

    LinkEnvironment

    Link environment

Example

Create an instance of the LinkService class passing along the accessToken and environment arguments. Each method takes a customerId and a completion handler which returns a Swift Result type.

Example
1import LinkAccount
2
3let service = LinkService(accesstoken, .production)
4service.getCustomer(customerId) {
5	switch result {
6	case .success(let value):
7		print("Customer: \(value.firstName) \(value.lastName)")
8	case .failure(let error):
9		print("Failed to retrieve customer: \(error)")
10	}
11}

Methods

LinkCustomer

  • id

    string

    Customer ID

  • firstName

    string

    Customer’s first name

  • lastName

    string

    Customer’s last name

  • email

    string

    Customer’s email

  • status

    enum

    ACTIVE or CREATED

  • creationDate

    Date

    Account creation date

LinkAuthorizedAccount

  • accountId

    int

    Account ID

  • financialInstitutionId

    int

    Financial institution ID

  • financialInstitutionName

    string

    Financial Institution name

  • logoUrl

    URL | null

    URL for a financial institution’s logo, when available

  • lastFour

    string

    Last four digits of a bank account number

  • type

    enum

    CHECKING or SAVINGS

  • status

    enum

    ACTIVE or INACTIVE or ABANDON or CREATED

  • creationDate

    Date

    Account creation date