Skip to content

Commit 9228efa

Browse files
notif: Move NotificationOpenService init at the start of NotificationService init
NotificationOpenService.instance.start already handles all the platforms itself, by doing nothing on all except iOS, so move it's initialization out of the platform-specific switch here.
1 parent 2b7ab49 commit 9228efa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/notifications/receive.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class NotificationService {
5353
ValueNotifier<String?> token = ValueNotifier(null);
5454

5555
Future<void> start() async {
56+
await NotificationOpenService.instance.start();
57+
5658
switch (defaultTargetPlatform) {
5759
case TargetPlatform.android:
5860
await ZulipBinding.instance.firebaseInitializeApp(
@@ -79,8 +81,6 @@ class NotificationService {
7981
await _getFcmToken();
8082

8183
case TargetPlatform.iOS: // TODO(#324): defer requesting notif permission
82-
await NotificationOpenService.instance.start();
83-
8484
await ZulipBinding.instance.firebaseInitializeApp(
8585
options: kFirebaseOptionsIos);
8686

0 commit comments

Comments
 (0)