Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Android] Unable to debug headless background fetch events #21

Closed
gitboss opened this issue Mar 30, 2019 · 1 comment
Closed

[BUG] [Android] Unable to debug headless background fetch events #21

gitboss opened this issue Mar 30, 2019 · 1 comment

Comments

@gitboss
Copy link

gitboss commented Mar 30, 2019

Plugin version: 0.2.0
Platform: Android

Steps to reproduce the behavior:

  1. Run the example app in emulator from VS Code.

  2. Execute the following in Windows 10 command prompt cmd :
    adb shell am broadcast -a com.transistorsoft.flutter.backgroundfetch.backgroundfetchexample.event.BACKGROUND_FETCH

  3. Output :
    Broadcasting: Intent { act=com.transistorsoft.flutter.backgroundfetch.backgroundfetchexample.event.BACKGROUND_FETCH flg=0x400000 }
    Broadcast completed: result=0

  4. However the event is neither logged by the example app in the emulator nor can we debug the code.

Note: Simulating the following other event works as expected -
"adb shell cmd jobscheduler run -f com.transistorsoft.flutter.backgroundfetch.backgroundfetchexample 999"

@christocracy
Copy link
Member

That's right. For devices run Android 21+, fetch uses the modern JobScheduler mechanism, ie:

adb shell cmd jobscheduler run -f com.transistorsoft.flutter.backgroundfetch.backgroundfetchexample 999"

For all older device, it uses AlarmManager, ie:

adb shell am broadcast -a ...

The plugin uses one or the other, not both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants