fix null safety

This commit is contained in:
2021-09-11 16:56:20 +06:30
parent a4d3777e8a
commit fe799ad820
32 changed files with 125 additions and 93 deletions

View File

@@ -45,9 +45,13 @@ class MessagingFCM {
}
});
String? token = await _firebaseMessaging.getToken();
if (onSetupComplete != null && token != null) onSetupComplete(token);
log.info("Messaging Token:$token");
try {
String? token = await _firebaseMessaging.getToken();
if (onSetupComplete != null && token != null) onSetupComplete(token);
log.info("Messaging Token:$token");
} on Exception catch (e) {
log.shout("Unable to get messing token:$e");
}
}
Future<void> subscribeToTopic(String topic) {