fix: Push on conduit

This commit is contained in:
Christian Pauly 2020-09-17 17:00:21 +02:00
parent 038a1df161
commit e5cd14447b

View file

@ -53,7 +53,10 @@ abstract class FirebaseController {
} }
return; 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); final currentPushers = pushers.where((pusher) => pusher.pushkey == token);
if (currentPushers.length == 1 && if (currentPushers.length == 1 &&
currentPushers.first.kind == 'http' && currentPushers.first.kind == 'http' &&
@ -76,7 +79,8 @@ abstract class FirebaseController {
debugPrint('[Push] Remove legacy pusher for this device'); debugPrint('[Push] Remove legacy pusher for this device');
} }
} }
await client.setPusher( await client
.setPusher(
Pusher( Pusher(
token, token,
APP_ID, APP_ID,
@ -90,7 +94,11 @@ abstract class FirebaseController {
kind: 'http', kind: 'http',
), ),
append: false, append: false,
); )
.catchError((e) {
debugPrint('[Push] Unable to set pushers: ${e.toString()}');
return [];
});
} }
Function goToRoom = (dynamic message) async { Function goToRoom = (dynamic message) async {