My app needs background location, but in some conditions and screens, it doesn't.
In one of that cases, when I request location with LOCATION_WHEN_IN_USE, I see this location modal ;
When I press "Allow While Using The App" now I get;
Which actually I don't need it in this case at all since It is unnecessary for the user to give background location on this screen. But I know that it appears because the background location is enabled on my app.
I am not sure if it is possible but mainly I want to be able to disable the second modal programmatically if that is possible.
Why it is needed?
My app needs background location, but in some conditions and screens, it doesn't.
In one of that cases, when I request location with LOCATION_WHEN_IN_USE, I see this location modal ;
When I press "Allow While Using The App" now I get;
Which actually I don't need it in this case at all since It is unnecessary for the user to give background location on this screen. But I know that it appears because the background location is enabled on my app.
I am not sure if it is possible but mainly I want to be able to disable the second modal programmatically if that is possible.
Possible implementation
No response
Code sample
No response