Geofencing on managed workflow iOS

Please provide the following:

  1. SDK Version: 37
  2. Platforms(Android/iOS/web/all): iOS
  3. Expo Client Version: 2.15.5
  4. Device: iPhone 11 Pro (iOS 13.4.1)

Hi!

I’m in the process of building a small app that will utilize Geofencing feature and encountered with an error when calling Location.startGeofencingAsync (stacktrace at the end of this post)

After googling little bit, this looked like a permission related issue in latest iOS. app.json’s ios field looks like this.

...,
"ios": {
  ...,
  "infoPlist": {
        "UIBackgroundModes": ["location", "fetch"],
        "NSLocationWhenInUseUsageDescription": "Allow HereHere to use your location",
        "NSLocationAlwaysUsageDescription": "Allow HereHere to use your location in the background for GeoFencing",
        "NSLocationAlwaysAndWhenInUseUsageDescription": "Allow HereHere to use your location in the background for GeoFencing"
      }
  }

So I built a standalone app and tested in iOS simulator, and it seems to be working! I’m wondering if there’s a way to get this working in development flow and would appreciate any pointer!

Thanks! And here’s minimal(?)-ish code that I was able to reproduce the issue. https://github.com/arthurpark/ExpoGeofence

[Unhandled promise rejection: Error: Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient) || _CFMZEnabled()]
- node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:99:50 in fn
- node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.js:15:46 in moduleName.methodInfo.name
- node_modules/expo-location/build/Location.js:361:44 in startGeofencingAsync
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:274:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:170:17 in PromiseImpl$argument_0
- node_modules/promise/setimmediate/core.js:45:7 in tryCallTwo
- node_modules/promise/setimmediate/core.js:200:23 in doResolve
- node_modules/promise/setimmediate/core.js:66:12 in Promise
- node_modules/regenerator-runtime/runtime.js:169:31 in PromiseImpl$argument_0
- node_modules/regenerator-runtime/runtime.js:192:38 in enqueue
- node_modules/regenerator-runtime/runtime.js:219:8 in exports.async
- node_modules/expo-location/build/Location.js:358:7 in startGeofencingAsync
* Test.tsx:171:19 in Button.props.onPress
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:274:30 in invoke
- node_modules/regenerator-runtime/runtime.js:45:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:135:28 in invoke
- node_modules/regenerator-runtime/runtime.js:145:19 in PromiseImpl.resolve.then$argument_0
- node_modules/promise/setimmediate/core.js:37:14 in tryCallOne
- node_modules/promise/setimmediate/core.js:123:25 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:146:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:194:17 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:458:30 in callImmediates
* [native code]:null in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:407:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:143:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:384:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:142:17 in __guard$argument_0
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

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