flutter_background_fetch icon indicating copy to clipboard operation
flutter_background_fetch copied to clipboard

[BUG] Documentation does not describe return values of `configure`

Open tomkcook opened this issue 2 years ago • 7 comments

Your Environment

  • Plugin version:1.1.0
  • Platform: Android
  • OS version:11
  • Device manufacturer / model: OnePlus 7

The documentation for this plugin doesn't describe the return values of configure or what failure cases may occur.

I see configure repeatedly returning 2. Another ticket seems to suggest this might mean "denied" but I can't find any documentation on this.

What do the return values mean? If 2 means "denied", what can cause this?

tomkcook avatar Sep 30 '22 13:09 tomkcook

For iOS you can deduce from here that an integer response (2) is UIBackgroundRefreshStatusAvailable .

For Android it seems to be always 2: https://github.com/transistorsoft/transistor-background-fetch/blob/master/android/tsbackgroundfetch/src/main/java/com/transistorsoft/tsbackgroundfetch/BackgroundFetch.java#L37

https://github.com/transistorsoft/transistor-background-fetch/blob/master/android/tsbackgroundfetch/src/main/java/com/transistorsoft/tsbackgroundfetch/BackgroundFetch.java#L208

This is the flutter side: https://github.com/transistorsoft/flutter_background_fetch/blob/master/lib/background_fetch.dart#L391

zobo avatar Oct 12 '22 12:10 zobo

Yes, the docs could be improved.

yes, status 2 means all good

Only iOS has a mechanism via Settings for disabling background-fetch events. Android has no such mechanism for disabling, so is always 2

christocracy avatar Oct 12 '22 12:10 christocracy

what about BackgroundFetch.registerHeadlessTask() ?

ivanesi avatar Dec 27 '22 14:12 ivanesi

What about it?

christocracy avatar Dec 27 '22 14:12 christocracy

it returns bool - what does it mean?

ivanesi avatar Dec 27 '22 14:12 ivanesi

Means it was successful?

christocracy avatar Dec 27 '22 14:12 christocracy

I guess, asked to be sure, thanks

ivanesi avatar Dec 27 '22 14:12 ivanesi

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 17 '24 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 01 '24 01:05 github-actions[bot]