transistorsoft/flutter_background_fetch

[BUG] Background fetch is not working on release app while running in iPhone

neeluagrawal04 opened this issue · 2 comments

Your Environment

  • Plugin version: 1.1.0
  • Platform: iOS
  • Device manufacturer / model: iPhone 11
  • Flutter info (flutter info, flutter doctor):
  • Plugin config: background_fetch

To Reproduce
Steps to reproduce the behavior:

  1. run the sample in release mode in ios
  2. observe the issue

Debug logs
Ui does not chnages to task while it always shows Waiting for fetch events. and screen stays in same mode.
2022-05-21 17:30:02.360438+0530 Runner[3369:215649] [TSBackgroundFetch load]: (
""
)
2022-05-21 17:30:02.361480+0530 Runner[3369:215649] [TSBGAppRefreshSubscriber load]: {
"flutter_background_fetch" = "";
}
2022-05-21 17:30:02.407357+0530 Runner[3369:215649] Metal API Validation Enabled
2022-05-21 17:30:02.423425+0530 Runner[3369:215649] [TSBackgroundFetch registerForTaskWithIdentifier: com.transistorsoft.customtask
2022-05-21 17:30:02.445627+0530 Runner[3369:215649] [TSBackgroundFetch scheduleBGAppRefresh] com.transistorsoft.fetch
2022-05-21 17:30:02.446561+0530 Runner[3369:215890] flutter: [BackgroundFetch] configure success: 2
2022-05-21 17:30:02.446674+0530 Runner[3369:215649] [TSBackgroundFetch scheduleProcessingTask]

Please fix this issue for ios

What Flutter version are you using? Do you have dart/swift obfuscation or minification enabled? Maybe you need to add something like

@pragma('vm:entry-point')

above your backgroundFetchHeadlessTask (or similar)

If it works with Simulated events on a release build initiated by XCode, that’s all you need to know that everything is wired up correctly.

it can take days before iOS` machine-learning model analyzes the user behaviour with your app (ie how long and when the user interacts with your app) and begins regularly firing events.

the best thing you can do is periodically open your app like a normal user would.

If the user never opens your for about 24 hours, iOS halts events.