updateTokens method

  1. @override
Future<void> updateTokens({
  1. required String accessToken,
  2. String? refreshToken,
})
override

Updates the access token (and optionally refresh token) for the current session.

Use this after receiving an auth error event when using a custom sync URL or when your backend provides new tokens. The SDK will automatically retry any pending uploads with the new credential.

Implementation

@override
Future<void> updateTokens({
  required String accessToken,
  String? refreshToken,
}) async {
  await _channel.invokeMethod<void>('updateTokens', {
    'accessToken': accessToken,
    if (refreshToken != null) 'refreshToken': refreshToken,
  });
}