Standalone iOS App cannot get location in TestFlight


#1

I’m using Expo to get the user’s current location in the splash screen of my app before sending them to either the log in screen, if the user hasn’t signed in, or the home screen if they have.

Whilst this worked fine, when using the app on both the physical device and the simulator when using Expo XDE, when I now try to use the app in TestFlight, when deploying to the App Store, it seems like the app is just getting stuck on trying to get the location, since I don’t see any calls to the api to check for logged in status (when I check the logs).

The relevant code is as follows:

  getLocation = async () => {
    let { status } = await Permissions.askAsync(Permissions.LOCATION);
    if (status !== 'granted') {
      this.setState({
        errorMessage: 'Permission to access location was denied',
      });
      alert('We don\'t have permission to access your location');
      return;
    }
    navigator.geolocation.getCurrentPosition(
      (position) => {
        this.setState({
          ...this.state,
          latitude: position.coords.latitude,
          longitude: position.coords.longitude,
          latitudeDelta: 0.005,
          longitudeDelta: 0.005,
          error: null,
        });
        this.props.dispatch(setLocation(position));
        this.authenticateSession();
      },
      (error) => this.setState({ error: error.message }),
        { enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 },
    );
  }

And my app.json file is as follows:


"ios": {
      "supportsTablet": false,
      "buildNumber": "1.0.2",
      "bundleIdentifier": X,
      "config": {
        "googleMapsApiKey": XXX
      }
    },

Does anyone have any experience with this? Could it be that location services are just disabled on the TestFlight apps? Or is it an issue with Expo?

Thanks in advance


#2

It seems like it’s probably related to this. Expo standalone iOS app stuck on splash screen, so going to rebuild and see if that helps. I didn’t notice any specific differences for location on standalone apps in the documentation, so I presume it’s not an issue in the code.


#3

This has been fixed by building a new version, as in the link: Expo standalone iOS app stuck on splash screen


#4

Awesome! Glad you got it sorted :slight_smile:


closed #5

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.