JulianAssmann / flutter_background

A flutter plugin to keep apps running in the background via foreground services. Android only.
https://pub.dev/packages/flutter_background
MIT License
86 stars 46 forks source link

Running await FlutterBackground.hasPermissions first time crashes the app #7

Closed adinortey360 closed 3 years ago

adinortey360 commented 3 years ago

Running await FlutterBackground.hasPermissions for the first time crashes the app after the user click enable ignore battery optimization button.

JulianAssmann commented 3 years ago

Thank you for th error report! I will look into it when I have some time (might be a little bit). Do you have any error logs from the console you could provide?

JulianAssmann commented 3 years ago

This should now be resolved by PR #12 I will close this issue, but if the bug persits, please don't hesitate to reopen it and let me know.

tygm commented 3 years ago

This may be a problem with other plug-ins, such as flutter screen Recording, this plug-in calls the onactivityresult method, but the third parameter data:Intent is not nullable . When applying for power optimization, you will receive an empty intent, resulting in a crash

JulianAssmann commented 3 years ago

I think I have a nullable Intent?, see here, right?