Good to know: account linking is useful if you wish to use AIS (Account Information Service) or skip authentication steps when initiating payments via the in-app payments module.
Implement invocation function in native module
In order to configure kevin. SDK account linking module, you will need to add configurations into the native platform specific components.
For additional information on available SDK configuration parameters, please refer to the corresponding platform-specific section of our documentation.
Handle SDK callbacks
To get results from kevin. SDK account linking flow you need to override platform-specific callbacks.
Android
Android handler module should conform to ActivityEventListener and should override onActivityResult(activity: Activity?, requestCode: Int, resultCode: Int, data: Intent?)
KevinModule.kt
class KevinModule internal constructor(context: ReactApplicationContext?) :
ReactContextBaseJavaModule(context), ActivityEventListener {
//...
override fun onActivityResult(
activity: Activity?,
requestCode: Int,
resultCode: Int,
data: Intent?
) {
if (requestCode == REQUEST_CODE_ACCOUNT_LINKING) {
val result = data?.getParcelableExtra<SessionResult<AccountSessionResult>>(AccountSessionContract.RESULT_KEY)
when (result) {
is SessionResult.Success -> {
callback?.invoke(null, result.value.authorizationCode)
}
is SessionResult.Canceled -> {
callback?.invoke("Canceled", null)
}
is SessionResult.Failure -> {
callback?.invoke("Failed", null)
}
}
}
}
}
iOS
iOS handler module should conform to KevinAccountLinkingSessionDelegate and override those methods: