Catch token errors
This commit is contained in:
parent
4abe20d7a1
commit
7a071374a3
1 changed files with 5 additions and 1 deletions
|
|
@ -14,7 +14,11 @@ class PushService {
|
||||||
FirebaseMessaging.instance.onTokenRefresh.listen(_uploadToken);
|
FirebaseMessaging.instance.onTokenRefresh.listen(_uploadToken);
|
||||||
bg.BackgroundGeolocation.onEnabledChange((enabled) async {
|
bg.BackgroundGeolocation.onEnabledChange((enabled) async {
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
|
try {
|
||||||
_uploadToken(await FirebaseMessaging.instance.getToken());
|
_uploadToken(await FirebaseMessaging.instance.getToken());
|
||||||
|
} catch (error) {
|
||||||
|
developer.log('Failed to get notificaion token', error: error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue