Plist configuration options are not recognised

I am trying to get Geofencing working in my managed app but I am running into a hurdle when enabling ‘Background Location’.

Despite updating my app.json file with the workaround suggested in the documentation I keep receiving the following error when calling Location.startGeofencingAsync(taskName, region):

Error: Background Location has not been configured. To enable it, add `location` to `UIBackgroundModes` in Info.plist file.

As a managed app, I do not have access to the Info.plist file and updating the app.json file appears to have no effect.
I have tried both a macintosh machine and a windows machine as well as previous versions of the expo-cli from 18.0.0 → 19.5.0
I would really appreciate some guidance or help to remove this error.
FYI, I can re-create the error by running expo init, expo install expo-location and adding the following to the app.js file:

timport React from "react";
import { StyleSheet, Text, View } from "react-native";

import * as Location from "expo-location";

export default function App() {
  Location.startGeofencingAsync("test", [
    { latitude: 37, longitude: 144, radius: 15 }
  ])
    .then(console.log)
    .catch(console.log);

  return (
    <View style={styles.container}>
      <Text>Open up App.js to start working on your app</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#fff",
    alignItems: "center",
    justifyContent: "center"
  }
});

And this to the app.json file:

{
  "expo": {
    "name": "alhmp",
    "slug": "alhmp",
    "privacy": "public",
    "sdkVersion": "33.0.0",
    "platforms": ["ios", "android", "web"],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/alhmp.png",
      "resizeMode": "contain",
      "backgroundColor": "#151515"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true,
      "infoPlist": {
        "UIBackgroundModes": ["location", "fetch"]
      }
    }
  }
}

Hi @ahvmckay!

Unfortunately, the iOS Expo client app no longer has access to background Location :frowning:

But, you can use a custom Expo Client to acheive this! For more info read here-> https://docs.expo.io/versions/latest/guides/adhoc-builds/

Hi @charliecruzan,

Was part of this update the removal of support for Google Maps inside for iOS?

I have an application that uses the MapView component with provider prop set to "google" and the ios.config.googleMapsApiKey set in app.json:

  • When running it in the regular expo application it works perfectly.
  • When running it inside of the custom expo application it crashes on startup.
  • If I comment out the provider prop, the custom expo application works using apple maps.

I can replicate this issue inside of a clean blank project, where the only two files I have changed are app.js and app.json.

App.js

import { StyleSheet, View } from "react-native";
import MapView from "react-native-maps";

export default function App() {
  return (
    <View style={styles.container}>
      <MapView
        initialRegion={{
          latitude: -37,
          longitude: 144,
          latitudeDelta: 0.0005,
          longitudeDelta: 0.0005
        }}
        mapType={"satellite"}
        provider={"google"}
        showsMyLocationButton
        showsUserLocation
        style={{ flex: 1 }}
      />
    </View>
  );
}

const styles = StyleSheet.create({
container: {
    flex: 1
  }
});

app.json

{
  "expo": {
    ...
    "ios": {
      "supportsTablet": true,
      "config": {
        "googleMapsApiKey": "..."
      }
    }
  }
}

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