Search code examples
flutterfirebasepush-notificationbackground-fetch

Flutter Fetch API in background when App is terminated


I'm want to fetch API every 15min and check if anything changes. Then if it does send push notification to inform the user about changes. Now my problem is that I cannot get to run the check on IOS. Does anyone have a solution for this?


Solution

  • There is a tool: https://pub.dev/packages/background_fetch, but it's not the perfect Dart solution for iOS to schedule background tasks as android when the app terminates, so try using Alarm Manager and Flutter WorkManager

    Also, you can try native side implementation with BGTaskScheduler