Skip to content

Conversation

@ahmetakil
Copy link

Fixes issues:

#76
#56

From my testing what I noticed is (Device: Samsung S23+) initially when the app requests the battery optimization, when user accepts PermissionActivityResultListener.onActivityResult is never called and initialize never returns to Flutter

My changes uses the lifecycle hooks onActivityPaused and onActivityResumed to actually respond when user taps the battery optimization dialog

With my changes:

  • Flutter calls FlutterBackground.initialize
  • User sees the battery optimization prompts and when accepts
  • The handleBatteryOptimizationReturn is invoked
  • Responds to flutter with the result

@ahmetakil ahmetakil changed the title Fix battery optimization not invoking callback Fix Android battery optimization not invoking callback Aug 21, 2025
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

Successfully merging this pull request may close these issues.

1 participant