subscribe method

  1. @override
Future subscribe(
  1. BuildContext context, {
  2. bool configureBackground = false,
})
override

Implementation

@override
Future subscribe(BuildContext context,
    {bool configureBackground = false}) async {
  _subs.add(FirebaseMessaging.onMessage.listen((event) {
    final msg = extractMessage(event.data);
    log.info("OnMessage received: ${event.data}");
    newMessage(PushSource.foreground, msg);
  }));
  _subs.add(FirebaseMessaging.onMessageOpenedApp.listen((event) {
    final msg = extractMessage(event.data);
    log.info("OnLaunch received: ${event.data}");
    newMessage(PushSource.resume, msg);
  }));
}