flutter-radar icon indicating copy to clipboard operation
flutter-radar copied to clipboard

Location permission not asked by SDK for background

Open tushar0518 opened this issue 9 months ago • 1 comments

First, thanks for the plugin,

Description of the problem:

  1. When we fetch the status permission using the getPermissionsStatus function, it always returns "DENIED"

Expected outcome: It should return "NOT_DETERMINED" at the first launch or before permission.

  1. When we ask permission using this function await Radar.requestPermissions(false);

As we pass false for foreground permission, it asks the permission But when we passed true for background permission, it didn't ask the permission for location.

@KennyHuRadar, Please look into this issue as it impacts our background functionality.

tushar0518 avatar Apr 01 '25 11:04 tushar0518

  1. We currently do not differentiate between "DENIED" and "NOT_DETERMINED" in the SDK.
  2. We can call await Radar.requestPermissions(true); after we called await Radar.requestPermissions(false); to request for background location permissions after we requested for foreground location permissions.

KennyHuRadar avatar Apr 01 '25 14:04 KennyHuRadar

Closing unless there are any other issues

KennyHuRadar avatar Apr 08 '25 13:04 KennyHuRadar