Skip to content

Prompt user to turn on location services if off #353

@Arron-Gill

Description

@Arron-Gill

I have a quick question regarding @react-native-community/geolocation and its functionality on Android.

We've recently migrated from react-native-geolocation-service to @react-native-community/geolocation, but we noticed that the getCurrentPosition function is missing a key feature—the ability to prompt users to enable location services if they are turned off.

In react-native-geolocation-service, this was easily handled using the showLocationDialog prop. However, I couldn't find a similar option in @react-native-community/geolocation. It seems to manage permissions but does not handle enabling the location service itself. Others seem to have the same issue.

We’d like to avoid introducing additional dependencies such as react-native-android-location-enabler or reverting to react-native-geolocation-service, as they don't appear to be actively maintained. Implementing this natively via a React Native bridge is an option, but with the new architecture, this could introduce long-term challenges.

Would you have any recommendations on how to achieve this within @react-native-community/geolocation? Any guidance would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions