Don't break when we're unable to fetch the push token

This commit is contained in:
vishnukvmd 2022-01-07 13:03:31 +05:30
parent 6c8d37824d
commit 9115ee8791

View file

@ -34,12 +34,16 @@ class PushService {
_logger.info("Got a message whilst in the foreground!");
_handleForegroundPushMessage(message);
});
if (Configuration.instance.hasConfiguredAccount()) {
await _configurePushToken();
} else {
Bus.instance.on<SignedInEvent>().listen((_) async {
_configurePushToken();
});
try {
if (Configuration.instance.hasConfiguredAccount()) {
await _configurePushToken();
} else {
Bus.instance.on<SignedInEvent>().listen((_) async {
_configurePushToken();
});
}
} catch (e, s) {
_logger.severe("Could not configure push token", e, s);
}
}