- Minimum Android 6.0 (API level 23) is now required (previously Android 5.0, API level 21).
- Minimum Android Studio version is Flamingo 2022.2.1 (previously Android Studio Dolphin 2021.3.1).
Tink dependency definition in Maven Central has changed.
- In your
build.gradle
product module file replace:
dependencies {
implementation 'com.tink:link-ui:0.16.0'
}
With:
dependencies {
implementation 'com.tink:link:2+'
}
- Sync the changes.
There's no need to define a style resource file (e.g., sample version prior 2.0). Styling is now defined via the type-conforming TinkAppearance protocol.
- Previous activity definition with Tink Link Android version prior 2.0:
<activity
android:name="com.tink.link.ui.TinkLinkUiActivity"
android:exported="false"
android:launchMode="singleTask">
</activity>
- New activity definition with Tink Link 2.0:
<activity
...
android:exported="true"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="YOUR_REDIRECT_URL_HOST"
android:scheme="YOUR_REDIRECT_URL_SCHEME" />
</intent-filter>
</activity>
- Previous implementation with Tink Link Android version prior 2.0:
val configuration = TinkConfiguration(
environment = Environment.Production,
oAuthClientId = "YOUR_CLIENT_ID",
redirectUri = Uri.parse("YOUR_REDIRECT_URI")
)
Tink.init(configuration, applicationContext)
- New implementation with Tink Link 2.0:
val configuration = Configuration(
clientId = "YOUR_CLIENT_ID",
redirectUri = "YOUR_REDIRECT_URI"
)
No more need to define onActivityResult
handler (e.g., sample version prior 2.0).
A resulting callback handler is now required during the product initialization step. (e.g., TinkAccountAggregation/authorizeForOneTimeAccess).
-
Tink.init call is removed. Tink class now used for access product flows only.
-
TinkConfiguration class is removed. Use Configuration class.
-
Environment is removed.
-
ProviderSelection class is removed. Use flow request class to define provider (e.g., AuthorizeForOneTimeAccess)
-
Scope class is removed. Use flow dedicated request class (e.g., AuthorizeForOneTimeAccess) to provide list of Scope enums.
-
CredentialsOperation class is removed. Use dedicated flow class (e.g., TinkAccountAggregation) to call operations.
-
TinkLinkUiActivity class is removed. It is no longer needed to start activity manually. To present product flow you need to call preferred one from product class (e.g., TinkAccountAggregation.authorizeForOneTimeAccess).
-
TinkLinkError class is removed. Utilize TinkError instead.
-
TinkLinkResult class is removed. Utilize product dedicated success class instead (e.g., TinkAccountAggregationSuccess in case of TinkAccountAggregation product).
- Previous implementation with Tink Link Android version prior 2.0:
val linkUser = createdUser()?.let { LinkUser.ExistingUser(it) }
?: authorizationCode()?.let { LinkUser.UnauthenticatedUser(it) }
?: LinkUser.TemporaryUser(market = "SE", locale = "sv_SE")
startActivityForResult(
TinkLinkUiActivity.createIntent(
context = this,
linkUser = linkUser,
scopes = listOf(Scope.AccountsRead),
styleResId = R.style.TinkLinkUiStyle,
credentialsOperation = CredentialsOperation.Create(ProviderSelection.ProviderList())
),
REQUEST_CODE
)
- New implementation with Tink Link 2.0:
val configuration = Configuration(
clientId = "YOUR_CLIENT_ID",
redirectUri = "YOUR_REDIRECT_URI"
)
val authorizationCode = "YOUR_AUTHORIZATION_CODE"
val request = AddCredentials(
authorizationCode = authorizationCode,
market = "SE",
scope = listOf(
Scope.USER_CREATE,
Scope.AUTHORIZATION_GRANT)
)
val appearance = makeMyTinkAppearance()
val launchMode = Modal(appearance)
Tink.AccountAggregation.addCredentials(
activity = this,
configuration = configuration,
request = request,
launchMode = launchMode,
onSuccess = { success: TinkAccountAggregationSuccess ->
Log.d("permanentAddCredentials", "SUCCESS")
},
onError = { error: TinkError ->
Log.d("permanentAddCredentials", "ERROR")
}
)
- Previous implementation with Tink Link Android version prior 2.0:
val linkUser = createdUser()?.let { LinkUser.ExistingUser(it) }
?: authorizationCode()?.let { LinkUser.UnauthenticatedUser(it) }
?: LinkUser.TemporaryUser(market = "SE", locale = "sv_SE")
startActivityForResult(
TinkLinkUiActivity.createIntent(
context = this,
linkUser = linkUser,
scopes = listOf(Scope.AccountsRead),
styleResId = R.style.TinkLinkUiStyle,
credentialsOperation = CredentialsOperation.Authenticate(credentialsId = "YOUR_CREDENTIALS_ID")
),
REQUEST_CODE
)
- New implementation with Tink Link 2.0:
val configuration = Configuration(
clientId = "YOUR_CLIENT_ID",
redirectUri = "YOUR_REDIRECT_URI"
)
val authorizationCode = "YOUR_AUTHORIZATION_CODE"
val credentialsId = "YOUR_CREDENTIALS_ID"
val request = AuthenticateCredentials(
authorizationCode = authorizationCode,
credentialsId = credentialsId,
market = "SE"
)
val appearance = makeMyTinkAppearance()
val launchMode = Modal(appearance)
Tink.AccountAggregation.authenticateCredentials(
activity = this,
configuration = configuration,
request = request,
launchMode = launchMode,
onSuccess = { success: TinkAccountAggregationSuccess ->
Log.d("permanentAuthenticateCredentials", "SUCCESS")
},
onError = { error: TinkError ->
Log.d("permanentAuthenticateCredentials", "ERROR")
}
)
- Previous implementation with Tink Link Android version prior 2.0:
val linkUser = createdUser()?.let { LinkUser.ExistingUser(it) }
?: authorizationCode()?.let { LinkUser.UnauthenticatedUser(it) }
?: LinkUser.TemporaryUser(market = "SE", locale = "sv_SE")
startActivityForResult(
TinkLinkUiActivity.createIntent(
context = this,
linkUser = linkUser,
scopes = listOf(Scope.AccountsRead),
styleResId = R.style.TinkLinkUiStyle,
credentialsOperation = CredentialsOperation.Refresh(credentialsId = "YOUR_CREDENTIALS_ID")
),
REQUEST_CODE
)
- New implementation with Tink Link 2.0:
val configuration = Configuration(
clientId = "YOUR_CLIENT_ID",
redirectUri = "YOUR_REDIRECT_URI"
)
val authorizationCode = "YOUR_AUTHORIZATION_CODE"
val credentialsId = "YOUR_CREDENTIALS_ID"
val request = RefreshCredentials(
authorizationCode = authorizationCode,
credentialsId = credentialsId,
market = "SE",
authenticate = true
)
val appearance = makeMyTinkAppearance()
val launchMode = Modal(appearance)
Tink.AccountAggregation.refreshCredentials(
activity = this,
configuration = configuration,
request = request,
launchMode = launchMode,
onSuccess = { success: TinkAccountAggregationSuccess ->
Log.d("permanentRefreshCredentials", "SUCCESS")
},
onError = { error: TinkError ->
Log.d("permanentRefreshCredentials", "ERROR")
}
)
Call is not available in Tink Link 2.0. Use Extend consent instead.
- Previous implementation with Tink Link Android version prior 2.0:
val linkUser = createdUser()?.let { LinkUser.ExistingUser(it) }
?: authorizationCode()?.let { LinkUser.UnauthenticatedUser(it) }
?: LinkUser.TemporaryUser(market = "SE", locale = "sv_SE")
startActivityForResult(
TinkLinkUiActivity.createIntent(
context = this,
linkUser = linkUser,
scopes = listOf(Scope.AccountsRead),
styleResId = R.style.TinkLinkUiStyle,
credentialsOperation = CredentialsOperation.Update(credentialsId = "YOUR_CREDENTIALS_ID")
),
REQUEST_CODE
)
- New implementation with Tink Link 2.0:
val configuration = Configuration(
clientId = "YOUR_CLIENT_ID",
redirectUri = "YOUR_REDIRECT_URI"
)
val market = "SE"
val request = ExtendConsent(
authorizationCode = "YOUR_AUTHORIZATION_CODE",
credentialsId = "YOUR_CREDENTIALS_ID",
market = market
)
val appearance = makeMyTinkAppearance()
val launchMode = Modal(appearance)
Tink.AccountAggregation.extendConsent(
activity = this,
configuration = configuration,
request = request,
launchMode = launchMode,
onSuccess = { success: TinkAccountAggregationSuccess ->
Log.d("permanentExtendConsent", "SUCCESS")
},
onError = { error: TinkError ->
Log.d("permanentExtendConsent", "ERROR")
}
)