setUserJwtProvider method
Registers a callback that supplies a fresh user JWT when the current one is about to expire or has been rejected.
The native SDK calls provider and retries the failed request once with
the returned token. Return null when a token cannot be supplied.
An empty string or a thrown error is treated the same as null.
Set the first token with setUserJwt before login. This callback only supplies later tokens. Call removeUserJwtProvider to stop asking.
On iOS and Android, the SDK stops waiting after 10 seconds. This plugin does not add its own timeout.
Note: this is not supported on web. Call setUserJwt again to refresh the token there.
Implementation
@override
Future<void> setUserJwtProvider(UserJwtProvider provider) async {
_userJwtProvider = provider;
_ensureMethodCallHandler();
await _channel.invokeMethod('setUserJwtProvider');
}