- iOS 13.
- Xcode 14.1.
- Swift 5.7.
In case you use SPM for dependency management you can update Tink Link up to the next major version by following these steps:
- Go to project settings and select
Package Dependencies
tab. - Double click on
tink-link-ios
. - Set
Rules
version toUp to Next Major
equals2.0.0
.
In case you use Cocoapods as a dependency manager you can update Tink Link up to the next major version by following these steps:
- In your
Podfile
make sure that iOS platform requirement is set to13
or higher, like:
platform :ios, '13.0'
- Now in your
Podfile
you can update TinkLink version up to the next major, such as:
pod 'TinkLink', '~> 2'
- In case if you are using
TinkLinkUI
you need to remove this pod from your Podfile. This pod is deprecated.
p̶o̶d̶-'T̶i̶n̶k̶L̶i̶n̶k̶U̶I̶'
- Finally make Cocoapods update dependencies:
pod install
-
Make sure that
Minimum Deployments
iOS version for your target is>= 13.0
. -
Check that
TinkLinkUI
is removed from theFrameworks, Libraries, and Embedded Content
configuration section of your target. This framework is deprecated. -
TinkLinkUI
import statement needs to be removed from your source code. -
Tink
general type has been transformed fromclass
intoenum
and is not intended to be initialized. Use it to access product subtypes. -
TinkLinkConfiguration
type is unavailable now. UseConfiguration
type instead. -
Appearance
type is unavailable now. TinkLink's appearance can now be customized via Tink Console. -
TinkLinkUIError
type is unavailable now. Rely on newTinkError
type. -
TinkLinkViewController
and its relatedOperation
,ProviderPredicate
,PrefillStrategy
andAuthenticationStrategy
types are unavailable now. UseTink
and its nested types to create the view controller for each product.
- Implementation with Tink Link iOS version prior 2.0:
let market = Market(code: "SE")
let providerPredicate = TinkLinkViewController.ProviderPredicate.kinds(.all)
let configuration = TinkLinkConfiguration(
clientID: "YOUR_CLIENT_ID",
appURI: URL(string: "YOUR_APP_URI")!,
callbackURI: URL(string: "YOUR_CALLBACK_URI")!,
environment: .production)
let scopes = [
Scope.statistics(.read),
Scope.transactions(.read), .categories(.read),
Scope.accounts(.read)
]
let viewController = TinkLinkViewController(configuration: configuration,
market: market,
scopes: scopes,
providerPredicate: providerPredicate) { result in
print(result)
}
present(viewController, animated: true)
- Implementation with Tink Link 2.0:
let configuration = Configuration(clientID: "YOUR_CLIENT_ID", redirectURI: "YOUR_REDIRECT_URI")
let market = Market("SE")
let scopes = [
Scope.statistics(.read),
Scope.transactions(.read), .categories(.read),
Scope.accounts(.read)
]
let viewController = Tink.AccountAggregation.authorizeForOneTimeAccess(configuration: configuration,
market: market,
scope: scopes) { (result: Result<OneTimeConnection, TinkError>) in
print(result)
}
present(viewController, animated: true)
- Implementation with Tink Link iOS version prior 2.0:
let market = Market(code: "SE")
let configuration = TinkLinkConfiguration(
clientID: "YOUR_CLIENT_ID",
appURI: URL(string: "tinklink://example")!,
callbackURI: URL(string: "tinklink://example")!,
environment: Tink.Environment.production)
let authenticationStrategy = AuthenticationStrategy.authorizationCode("YOUR_AUTHORIZATION_CODE")
let providerPredicate = TinkLinkViewController.ProviderPredicate.kinds(.all)
let operation = TinkLinkViewController.Operation.create(providerPredicate: providerPredicate)
let tinkLinkViewController = TinkLinkViewController(configuration: configuration,
market: market,
authenticationStrategy: authenticationStrategy,
operation: operation) { result in
print(result)
}
present(tinkLinkViewController, animated: true)
- Implementation with Tink Link 2.0:
let configuration = Configuration(clientID: "YOUR_CLIENT_ID", redirectURI: "YOUR_REDIRECT_URI")
let authorizationCode = AuthorizationCode("YOUR_AUTHORIZATION_CODE")
let market = Market("SE")
let viewController = Tink.AccountAggregation.addCredentials(configuration: configuration,
market: market,
authorizationCode: authorizationCode) { (result: Result<Credentials.ID, TinkError>) in
print(result)
}
present(viewController, animated: true)
- Implementation with Tink Link iOS version prior 2.0:
let market = Market(code: "SE")
let configuration = TinkLinkConfiguration(
clientID: "YOUR_CLIENT_ID",
appURI: URL(string: "tinklink://example")!,
callbackURI: URL(string: "tinklink://example")!,
environment: Tink.Environment.production)
let authenticationStrategy = AuthenticationStrategy.authorizationCode("YOUR_AUTHORIZATION_CODE")
let credentialsID = Credentials.ID("YOUR_CREDENTIALS_ID")
let operation = TinkLinkViewController.Operation.authenticate(credentialsID: credentialsID)
let tinkLinkViewController = TinkLinkViewController(configuration: configuration,
market: market,
authenticationStrategy: authenticationStrategy,
operation: operation) { result in
print(result)
}
present(tinkLinkViewController, animated: true)
- Implementation with Tink Link 2.0:
let configuration = Configuration(clientID: "YOUR_CLIENT_ID", redirectURI: "YOUR_REDIRECT_URI")
let authorizationCode = AuthorizationCode("YOUR_AUTHORIZATION_CODE")
let credentialsID = Credentials.ID("YOUR_CREDENTIALS_ID")
let viewController = Tink.AccountAggregation.authenticateCredentials(configuration: configuration,
authorizationCode: authorizationCode,
credentialsID: credentialsID) { (result: Result<Credentials.ID, TinkError>) in
print(result)
}
present(viewController, animated: true)
- Implementation with Tink Link iOS version prior 2.0:
let market = Market(code: "SE")
let configuration = TinkLinkConfiguration(
clientID: "YOUR_CLIENT_ID",
appURI: URL(string: "tinklink://example")!,
callbackURI: URL(string: "tinklink://example")!,
environment: Tink.Environment.production)
let authenticationStrategy = AuthenticationStrategy.authorizationCode("YOUR_AUTHORIZATION_CODE")
let credentialsID = Credentials.ID("YOUR_CREDENTIALS_ID")
let operation = TinkLinkViewController.Operation.refresh(credentialsID: credentialsID)
let tinkLinkViewController = TinkLinkViewController(configuration: configuration,
market: market,
authenticationStrategy: authenticationStrategy,
operation: operation) { result in
print(result)
}
present(tinkLinkViewController, animated: true)
- Implementation with Tink Link 2.0:
let configuration = Configuration(clientID: "YOUR_CLIENT_ID", redirectURI: "YOUR_REDIRECT_URI")
let authorizationCode = AuthorizationCode("YOUR_AUTHORIZATION_CODE")
let credentialsID = Credentials.ID("YOUR_CREDENTIALS_ID")
let viewController = Tink.AccountAggregation.refreshCredentials(configuration: configuration,
authorizationCode: authorizationCode,
credentialsID: credentialsID,
completion: { (result: Result<Credentials.ID, TinkError>) in
print(result)
})
present(viewController, animated: true)
Call is not available in Tink Link 2.0. Use Extend consent instead.
- Implementation with Tink Link 2.0:
let configuration = Configuration(clientID: "YOUR_CLIENT_ID", redirectURI: "YOUR_REDIRECT_URI")
let authorizationCode = AuthorizationCode("YOUR_AUTHORIZATION_CODE")
let credentialsID = Credentials.ID("YOUR_CREDENTIALS_ID")
let viewController = Tink.AccountAggregation.extendConsent(configuration: configuration,
authorizationCode: authorizationCode,
credentialsID: credentialsID,
completion: { (result: Result<Credentials.ID, TinkError>) in
print(result)
})
present(viewController, animated: true)