TinkMoneyManagerUI Documentation Beta

Class Tink

public class Tink

The Tink class encapsulates a connection to the Tink API.

By default a shared Tink instance will be used, but you can also create your own instance and use that instead. This allows you to use multiple Tink instances at the same time.

Nested Types

Tink.Configuration

Configuration used to set up the Tink

Tink.Environment

Represents which endpoints Tink will use.

Tink.UserError

Initializers

init(configuration:​)

public init(configuration: TinkCore.Configuration)

Create a Tink instance with a custom configuration.

Parameters

configuration Tink​Core.​Configuration

The configuration to be used.

Properties

available​Locales

var availableLocales: [Locale]

Available locales for Tink

default​Locale

var defaultLocale: Locale

Default available locale that will be used based on the current locale

shared

var shared: Tink

The shared Tink instance.

Note: You need to configure the shared instance by calling Tink.configure(with:) before accessing the shared instance. Not doing so will cause a run-time error.

session​Managers

var sessionManagers: [SessionManager] = []

user​Session

var userSession: UserSession?

The current user session associated with this Tink object.

When you set this property to some value, all requests made by this Tink object or any other object associated with it will try to authenticate using the provided user session credentials.

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.

configuration

let configuration: TinkCore.Configuration

The current configuration.

services

var services

Methods

refresh()

public func refresh()

Forces a refresh of all statistics data and the latest transactions for the current user.

reset​Cache()

public func resetCache()

Resets internal cache of data for the current user.

configure(with:​)

public static func configure(with configuration: TinkCore.Configuration)

Configure shared instance with configration description.

Here's how you could configure Tink with a Tink.Configuration.

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

Parameters

configuration Tink​Core.​Configuration

The configuration to be used for the shared instance.

authenticate​User(authorization​Code:​completion:​)

@discardableResult public func authenticateUser(authorizationCode: AuthorizationCode, completion: @escaping (Result<Void, Swift.Error>) -> Void) -> RetryCancellable?

Authenticate a permanent user with authorization code.

Parameters

authorization​Code Authorization​Code

Authenticate with a AuthorizationCode that delegated from Tink to exchanged for a user object.

completion @escaping (Result<Void, Swift.​Error>) -> Void

A result representing either a success or an error.

set​Credential(_:​)

@available(*, deprecated, message: "Set the userSession property directly instead.") public func setCredential(_ credential: SessionCredential?)

Sets the credential to be used for this Tink Context.

The credential is associated with a specific user which has been created and authenticated through the Tink API.

Parameters

credential Session​Credential?

The credential to use.