/tink-link-ios-1

Get the full picture of your customers’ finances with Tink Link iOS SDK.

Primary LanguageSwiftMIT LicenseMIT

Platform Languages CocoaPods Swift Package Manager Carthage

Tink Link iOS

Tink Link

Prerequisites

  1. Follow the getting started guide to retrieve your client_id.
  2. Add a deep link to your app with scheme and host (yourapp://host) to the list of redirect URIs under your app's settings.

Requirements

  • iOS 11.0
  • Xcode 11.4

Installation

There are two targets in the package Tink Link.

  • TinkLink is a framework for aggregating bank credentials, you can build your own UI, suitable for enterprise plan customers that are aggregating with permanent users.
  • TinkLinkUI is a framework with a predefined flow, a single entrypoint and configurable UI style, you can use this framework to bootstrap your application fast.

Read more about permanent users here.

Using Swift Package Manager

Follow these instructions to link a target to a package product and enter this URL https://github.com/tink-ab/tink-link-ios when asked for a package repository.

When finished, you should be able to import TinkLink and import TinkLinkUI within your project.

If you only need the headless SDK you don't need to import TinkLinkUI within your project.

Using CocoaPods

Refer to their guide for usage and installation instructions.

  1. Add TinkLink and TinkLinkUI to your Podfile.

    pod "TinkLink"
    pod "TinkLinkUI"
    
  2. Run pod install in your project directory.

  3. Open your .xcworkspace file to see the project in Xcode.

If you only need the headless SDK you don't need to include pod "TinkLinkUI" in your Podfile.

Manual installation

  1. Download and unzip the TinkCore.xcframework.zip from the latest Tink Core release.
  2. Drag the TinkCore.xcframework into the Frameworks, Libraries, and Embedded Content section on your application targets’ General tab.
  3. Download and unzip the Source code.zip from the latest Tink Link release.
  4. Add a new iOS Framework target with the name TinkLink to your app.
  5. Drag all files except Info.plist from Sources/TinkLink folder into the new target.
  6. Add a new iOS Framework target with the name TinkLinkUI to your app.
  7. Drag all files except Info.plist from Sources/TinkLinkUI folder into the new target.
  8. Install Kingfisher
  9. Install Down
  10. Add Kingfisher and Down to the TinkLinkUI target.

When finished, you should be able to import TinkLink and import TinkLinkUI within your project.

How to display Tink Link

  1. Import the SDK and set up a configuration with your client ID and redirect URI.

    import TinkLink
    import TinkLinkUI
    
    let configuration = TinkLinkConfiguration(clientID: <#String#>, appURI: <#URL#>)
  2. Define the list of scopes based on the type of data you want to fetch. For example, to retrieve accounts and transactions, define these scopes:

    let scopes: [Scope] = [
        .accounts(.read), 
        .transactions(.read)
    ]
  3. Create a TinkLinkViewController with your configuration, market, and list of scopes to use.

    let tinkLinkViewController = TinkLinkViewController(configuration: configuration, market: "SE", scopes: scopes) { result in 
        // Handle result
    }
  4. Tink Link is designed to be presented modally. Present the view controller by calling present(_:animated:) on the presenting view controller.

    present(tinkLinkViewController, animated: true)
  5. After the user has completed or cancelled the aggregation flow, the completion handler will be called with a result. A successful authentication will return a result that contains an authorization code that you can exchange for an access token. If something went wrong the result will contain an error.

    do {
        let authorizationCode = try result.get()
        // Exchange the authorization code for a access token.
    } catch {
        // Handle any errors
    }

Redirect handling

You will need to add a custom URL scheme or support universal links to handle redirects from a third party authentication flow back into your app.

Follow the instructions in one of these links to learn how to set this up:

Samples

These examples shows how to build a complete aggregation flow using TinkLink or TinkLinkUI.

Documentation

For more detailed usage and full documentation, please refer to our Tink Link for iOS guide.

Tink was founded in 2012 with the aim of changing the banking industry for the better. We have built Europe’s most robust open banking platform – with the broadest, deepest connectivity and powerful services that create value out of the financial data.

Support

👋 We are continuously working on improving the developer experience of our API offering. Contact us for support, questions or suggestions.