From e5cd14447bdfa21e89177b425f26823ccccf90d2 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Thu, 17 Sep 2020 17:00:21 +0200 Subject: [PATCH] fix: Push on conduit --- lib/utils/firebase_controller.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/utils/firebase_controller.dart b/lib/utils/firebase_controller.dart index f8c6e92..55138ad 100644 --- a/lib/utils/firebase_controller.dart +++ b/lib/utils/firebase_controller.dart @@ -53,7 +53,10 @@ abstract class FirebaseController { } return; } - final pushers = await client.requestPushers(); + final pushers = await client.requestPushers().catchError((e) { + debugPrint('[Push] Unable to request pushers: ${e.toString()}'); + return []; + }); final currentPushers = pushers.where((pusher) => pusher.pushkey == token); if (currentPushers.length == 1 && currentPushers.first.kind == 'http' && @@ -76,7 +79,8 @@ abstract class FirebaseController { debugPrint('[Push] Remove legacy pusher for this device'); } } - await client.setPusher( + await client + .setPusher( Pusher( token, APP_ID, @@ -90,7 +94,11 @@ abstract class FirebaseController { kind: 'http', ), append: false, - ); + ) + .catchError((e) { + debugPrint('[Push] Unable to set pushers: ${e.toString()}'); + return []; + }); } Function goToRoom = (dynamic message) async {