Swiftpack.co - Package - tink-ab/tink-link-ios

Platform Languages

Tink Link iOS

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 TinkLink and TinkLinkUI 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, suitable for customer aggregating with temporary users.

See the difference about the permanent user and temporary user

Installing TinkLink

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 within your project.

Using CocoaPods

Refer to their guide for usage and installation instructions.

  1. Add TinkLink to your Podfile.

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

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

Using Carthage

Refer to these instructions for usage and installation details.

  1. Add github "tink-ab/tink-link-ios" to your project's Cartfile.
  2. Run carthage update in your project directory.
  3. If you're building for iOS, in your copy frameworks run script, add these paths to your input and output file lists respectivly.
$(SRCROOT)/Carthage/Build/iOS/TinkCore.framework
$(SRCROOT)/Carthage/Build/iOS/TinkLink.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TinkCore.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TinkLink.framework

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

Installing TinkLinkUI

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.

Using Carthage

Refer to these instructions for usage and installation details.

  1. Add github "tink-ab/tink-link-ios" to your project's Cartfile.
  2. Run carthage update in your project directory.
  3. In your copy frameworks run script, add these paths to your input and output file lists respectivly.
$(SRCROOT)/Carthage/Build/iOS/TinkCore.framework
$(SRCROOT)/Carthage/Build/iOS/TinkLink.framework
$(SRCROOT)/Carthage/Build/iOS/TinkLinkUI.framework
$(SRCROOT)/Carthage/Build/iOS/Down.framework
$(SRCROOT)/Carthage/Build/iOS/Kingfisher.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TinkCore.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TinkLink.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TinkLinkUI.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Down.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Kingfisher.framework

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

Configuration

To start using Tink Link, you will need to configure a Tink instance with your client ID and redirect URI.

let configuration = try! Tink.Configuration(clientID: <#String#>, redirectURI: <#URL#>)
Tink.configure(with: configuration)

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:

Tutorials

Examples

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

Developer Documentation

Github

link
Stars: 7

Dependencies

Used By

Total: 0

Releases

Tink Link iOS 0.15.2 - 2020-09-11 12:11:43

  • Updated translations to TinkLinkUI for:
    • Danish
    • Dutch
    • English
    • Finnish
    • French
    • German
    • Italian
    • Norwegian
    • Portuguese
    • Spanish
    • Swedish

Tink Link iOS 0.15.1 - 2020-09-08 11:49:28

  • Added translations to TinkLinkUI for:
    • Danish
    • Dutch
    • Finnish
    • French
    • German
    • Italian
    • Norwegian
    • Portuguese
    • Spanish
  • Fixed temporary user creation for Norwegian locales.
  • Fixed an issue where the user could get stuck on the final screen if an authorization call failed.
  • Fixed Carthage support for TinkLink on macOS.

Tink Link iOS 0.15.0 - 2020-09-07 08:43:58

  • Added AuthenticationUserType to the Provider model. This indicates if a user authenticates toward the bank as a person or a business. The ProviderTree has a new node to represent this and in TinkLinkUI there's a new selection screen for banks that support both.
  • Contexts like CredentialsContext are now accessed via the Tink instance instead of instantiating them. For example: Tink.shared.credentialsContext.
  • When using TinkLinkViewController with temporary users the completion handler now returns the Credentials that were created.
  • Added support for installing TinkLinkUI with Carthage.
  • Reference documentation is now generated with swift-doc.
  • Networking layer and related models have moved to a new TinkCore framework. If you've been using Carthage, update the input/output file lists to include this framework.

Tink Link iOS 0.14.2 - 2020-08-12 07:51:55

  • Fixed an issue where the credentials form had the wrong content insets when the keyboard was showing.

Tink Link iOS 0.14.1 - 2020-06-25 13:54:33

  • Fixed an issue where you could get stuck in a error state in TinkLinkViewController.
  • Fixed an issue where sometimes the completion handler was not called when TinkLinkViewController was closed.

TinkLink iOS 0.14.0 - 2020-06-11 14:28:40

Support for adding beneficiaries

Tink Link now supports adding beneficiaries. Read more in the tutorial.

Improved the documentation

Required scopes are now specified for each context method.

Tink Link iOS 0.13.0 - 2020-06-08 15:00:49

Tink Link UI with permanent users

Tink Link UI can now be used with permanent users. You can create, update, refresh and authenticate credentials for your permanent users.

Here is an example how to setup Tink Link with a permanent user:

// Initialize with an authorization code. 
let tinkLinkViewController = TinkLinkViewController(authorizationCode: AuthorizationCode("YOUR_AUTHORIZATION_CODE")) { result in
    do {
        let credentials = try result.get()
    } catch {
        // Handle any errors
    }
}
present(tinkLinkViewController, animated: true)

// Initialize with an access token. 
let tinkLinkViewController = TinkLinkViewController(userSession: .accessToken("YOUR_ACCESS_TOKEN")) { result in
    do {
        let credentials = try result.get()
    } catch {
        // Handle any errors
    }
}
present(tinkLinkViewController, animated: true)

If you want to update, refresh or authenticate a credentials for a user, you need to specify the Operation you want to perform when you initialize the view controller. For example, if you want to update a credentials:

let tinkLinkViewController = TinkLinkViewController(userSession: .accessToken("YOUR_ACCESS_TOKEN"), operation: .update(credentialsID: id)) { result in 
    do {
        let credentials = try result.get()
    } catch {
        // Handle any errors
    }
}

Tink Link iOS 0.12.0 - 2020-05-29 14:07:04

Transfer initiation

Tink Link now supports initiating transfers. Read more in the tutorial.

Fetching transfer source accounts and destination beneficiaries

See more details on getting a source account and getting beneficiaries sections.

Initiate transfer

Initiate the transfer with the details specified. Read more on Initiating a transfer section.

Tink Link iOS 0.11.1 - 2020-05-14 08:53:59

Provider filtering and selection

Tink Link UI now supports opening directly to a specific provider.

TinkLinkViewController(market: "SE", scopes: scopes, providerPredicate: .name("se-test-open-banking-redirect")) { result in 
    // Handle result
}

The API for changing which providers to list has changed, use the new kinds case to only show certain providers.

TinkLinkViewController(market: "SE", scopes: scopes, providerPredicate: .kinds([.bank, .creditCard])) { result in 
    // Handle result
}

Carthage support

Tink Link can now be installed with Carthage. Add github "tink-ab/tink-link-ios" to your project's Cartfile and run carthage update to install.

Access type descriptions

Descriptions of different access types are now better described in Tink Link UI.

QR image improvements

The QR code in Tink Link UI is no longer blurry and matches the current theme.

Tink Link iOS 0.11.0 - 2020-05-07 11:37:44

User session

The API to set the user access token is now a property on the Tink object instead of a method. You can check if this property is not nil if you want to check if the Tink object is currently trying to authenticate with user session credentials.

Tink.shared.userSession = .accessToken(<#T##String#>)

Authenticating credentials

There's now a method to renew and extend the authentication for PSD2 connections.

credentialsContext.authenticate(credentials, progressHandler: { status in
    <#Handle status#>
}, completion: { result in
    <#Handle result#>
})

Update credentials

The update credentials method has a new parameter. Use the progress handler to handle additional authentication steps like supplemental information or authentication in a third party app.

credentialsContext.update(credentials, form: form, progressHandler: { status in
    switch status {
    case .awaitingSupplementalInformation(let supplementInformationTask):
        <#Present form for supplemental information task#>
    case .awaitingThirdPartyAppAuthentication(let thirdPartyAppAuthenticationTask):
        <#Open third party app deep link URL#>
    default:
        break
    }
}, completion: { result in
    <#Handle result#>
})

Tink Link iOS 0.10.0 - 2020-04-27 15:18:39

Tink Link UI

A new UI framework has been added. Import TinkLinkUI and use TinkLinkViewController to display a ready-made authentication flow with a few lines of code.

TinkLinkViewController(market: "SE", scopes: [.accounts(.read)]) { result in
    do {
        let authorizationCode = try result.get()
        // Exchange the authorization code for a access token.
    } catch {
        // Handle any errors
    }
}

Authenticating

The methods to authenticate a permanent user has been renamed and moved to the Tink class.

Tink.shared.setCredential(.accessToken(“ACCESS_TOKEN”))

In addition to moving the authentication methods to the Tink object, the different context classes like ProviderContext no longer require a User to be initialized. Instead, they will be automatically authenticated when the corresponding Tink object successfully authenticates.

Refreshable items

You can now specify what refreshable items you wish to aggregate when creating and refreshing credentials.

credentialsContext.add(for: provider, form: form, refreshableItems: .accounts, ...)

ThirdPartyAppAuthenticationTask have been redesigned

There is now a handle method that is used to attempt to open the third party app. There is an optional closure you can provide if you wish to handle the case when the app is missing the third party app.

// Will attempt to open third party app. If unsuccessful, will 
// fallback to displaying a QR code or allowing the 
// user to authenticate on another device. 
task.handle { [weak self] result in
    switch result {
    case .qrImage(let image):
        // Display the provided QR image. 
    case .awaitAuthenticationOnAnotherDevice:
        // Waiting for authentication on other device.
    }
}

Tink Link iOS 0.9.7 - 2020-03-24 16:29:34

  • Fixed an issue where BankID could be opened twice or AddCredentialsTask would stop updating.

Tink Link iOS 0.9.6 - 2020-03-24 15:04:27

  • Added missingInternetConnection error case for when device is offline.
  • Automatically retries requests when service is unavailable.

Tink Link iOS 0.9.5 - 2020-03-20 13:49:46

  • Third-party authentication BankID deep link redirects url fix.

Tink Link iOS 0.9.4 - 2020-03-19 15:17:01

  • Scope API has been redesigned.
  • New Provider Types have been added.
  • The SDK now handles unknown types more gracefully.

Tink Link iOS 0.9.3 - 2020-03-18 12:43:51

  • Renamed Credential to Credentials to align with Tink documentation.
  • Updated the access type sorting.
  • Iterated authorization error handling.
  • Updated the docs.

Tink Link iOS 0.9.2 - 2020-02-25 14:47:48

  • Renamed module from TinkLinkSDK to TinkLink.
  • Renamed main object from TinkLink to Tink.
  • Added method to get descriptions for a set of scopes.
  • Added methods to get links to Terms and Conditions and Privacy Policy.

Tink Link iOS 0.9.1 - 2020-02-10 10:47:14

  • Sample app updates.
  • Added the reference doc.
  • Fixed a problem that can cause authorization headers to be added twice to requests.

Tink Link iOS 0.9.0 - 2020-01-28 14:41:55