withVKIDToken
fun <T> ApiCommand<T>.withVKIDToken(refreshTokenParamsProvider: () -> VKIDRefreshTokenParams = { VKIDRefreshTokenParams {} }): ApiCommand<T>
Add compatibility for vk-android-sdk with vkid-android-sdk to the request.
This adds two things:
Automatically uses VKID access token for the request
Refreshes access token if necessary
This extension adds two exceptions as the possible outcomes:
VKIDNotAuthorizedException if the user wasn't authorized before executing the command
VKIDRefreshTokenFailException if the SDK failed to refresh token
Parameters
refreshTokenParamsProvider
Providers parameters for token refreshing. This can be useful if you want to generate PKCE parameters yourself.