Skip to content

Commit 9d565ac

Browse files
committed
🐛(fix) remove console error in chatState.
1.:bug: if remote config is not present in firebase then there is error on console.
1 parent 61783bd commit 9d565ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/state/chats/chatState.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ class ChatState extends AppState {
8484
await remoteConfig.fetch(expiration: const Duration(hours: 5));
8585
await remoteConfig.activateFetched();
8686
var data = remoteConfig.getString('FcmServerKey');
87-
if (data != null) {
87+
if (data != null && data.isNotEmpty) {
8888
serverToken = jsonDecode(data)["key"];
8989
}
90+
else{
91+
cprint("Please configure Remote config in firebase", errorIn: "getFCMServerKey");
92+
}
9093
}
9194

9295
/// Fetch users list to who have ever engaged in chat message with logged-in user

0 commit comments

Comments
 (0)