Skip to content

[Android: Location Tracking] location observer not triggering updates (foreground/background) in Expo React Native app #13

@asaveiadelin

Description

@asaveiadelin

I installed it in a React Native project using Expo.

I followed the background location example provided in the package documentation: https://github.com/HyopeR/react-native-location/blob/master/example/src/pages/BackgroundPage/index.tsx

On iOS, the location observer works correctly:

  • When the device location changes, the observer callback is triggered.
 const onChange = useCallback<OnChangeEvent>(locations => {
    if (locations.length > 0) {
      const item = locations[0];
      setLocation(item);
      console.log(item);
    }
  }, []);

  • This works both in foreground and background modes.

However, on Android, the behavior is broken. The location observer does not receive any updates at all, neither when the app is in the foreground nor when it is running in the background.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions