Browse Source

Trigger sync when a background push is received

vishnukvmd 3 years ago
parent
commit
02c56e852f
1 changed files with 2 additions and 3 deletions
  1. 2 3
      lib/main.dart

+ 2 - 3
lib/main.dart

@@ -317,13 +317,12 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
         _scheduleSuicide(kBGPushTimeout); // To prevent OS from punishing us
       }
       await _init(true);
-      UpdateService.instance.showUpdateNotification();
       await _sync(isAppInBackground: true);
     }, prefix: "[bg]");
   } else {
     _logger
-        .info("Background push received, but app is already in the foreground");
-    // App has already been initialized, will let foreground handle everything
+        .info("Background push received when app is alive");
+    await _sync(isAppInBackground: true);
   }
 }