AuthorizationEvent¶
Authorization token refresh result delivered to BackgroundGeolocation.onAuthorization.
The SDK fires this event after each token refresh attempt triggered by AuthorizationConfig.refreshUrl. Use it to update your app's local credential store, handle refresh failures, or react to expired sessions.
BackgroundGeolocation.onAuthorization((AuthorizationEvent event) {
if (event.success) {
print('[onAuthorization] Token refreshed: ${event.response}');
// Update your app's stored token.
final token = event.response.access_token;
} else {
print('[onAuthorization] Refresh failed: ${event.error}');
}
});
Members¶
error¶
Error message when success is false; null otherwise.
response¶
Decoded JSON body returned by the refresh server when success is true;
null otherwise.
status¶
HTTP status code returned by AuthorizationConfig.refreshUrl, or
0 if the request failed before reaching the server.
success¶
true when the token refresh request returned a 2xx status code.