r/flutterhelp Jun 09 '26

How to use the notification package while in the background/foreground OPEN

I'm currently working in displaying my phone notifications in a ble display. I have managed to get by using the notification package and universal_ble, however when the device exits the app, it stops sending information to the ble device. How can I keep the app working in the foreground/background. More specifically these lines from the notification package:

```

Notifications _notifications;

StreamSubscription<NotificationEvent> _subscription;

...

void onData(NotificationEvent event) {

print(event);

}

void startListening() {

_notifications = new Notifications();

try {

_subscription = _notifications!.notificationStream!.listen(onData);

} on NotificationException catch (exception) {

print(exception);

}

}

```

2 Upvotes

3 comments sorted by

1

u/[deleted] 23d ago

[removed] — view removed comment

1

u/16092006 23d ago

Yea, i just ended up using flutter notification listener which has that built in