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.
Relationships
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
Name | Type | Description |
---|---|---|
configuration | TinkCore.Configuration |
The configuration to be used. |
Properties
availableLocales
var availableLocales: [Locale]
Available locales for Tink
defaultLocale
var defaultLocale: Locale
Default available locale that will be used based on the current locale
sessionManagers
var sessionManagers: [SessionManager] = []
userSession
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.
services
var services
Methods
refresh()
public func refresh()
Forces a refresh of all statistics data and the latest transactions for the current user.
resetCache()
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
Name | Type | Description |
---|---|---|
configuration | TinkCore.Configuration |
The configuration to be used for the shared instance. |
authenticateUser(authorizationCode:completion:)
@discardableResult public func authenticateUser(authorizationCode: AuthorizationCode, completion: @escaping (Result<Void, Swift.Error>) -> Void) -> RetryCancellable?
Authenticate a permanent user with authorization code.
Parameters
Name | Type | Description |
---|---|---|
authorizationCode | AuthorizationCode |
Authenticate with a |
completion | @escaping (Result<Void, Swift.Error>) -> Void |
A result representing either a success or an error. |
setCredential(_:)
@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
Name | Type | Description |
---|---|---|
credential | SessionCredential? |
The credential to use. |