Please provide the following:
- SDK Version: 37
- Platforms(Android/iOS/web/all): All (specifically iOS Simulator)
Hello Everyone!
I’ve been following the documentation trying to implement the startGeofencingAsync function. However, I’m getting the following error.
Error: Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient) || _CFMZEnabled()
I’ve followed the exact directions and the code that the Expo documentation provides. Initially, I’ve started by importing the correct libraries.
Here, I’m defining it in the global scope of my Javascript bundle.
const LOCATION_TASK_NAME = "background-location-task";
TaskManager.defineTask(LOCATION_TASK_NAME, ({ data, error }) => {
if (error) {
// Error occurred - check `error.message` for more details.
return;
}
if (data) {
const { locations } = data;
// do something with the locations captured in the background
console.log("Location data from Task Manager = " + locations);
}
});
Here, I have my startGeofencingAsync method in the componentDidMount method.
Location.startGeofencingAsync("LOCATION_TASK_NAME", [
{
identifier: "1",
latitude: 40.743293,
longitude: -73.9904096,
radius: 50,
notifyOnEnter: true,
notifyOnExit: true,
},
])
.then((response) => {
if (response) {
console.log("Response from startGeoFencingAsync() = " + response);
}
})
.catch((error) => {
if (error) {
console.log("Error from startGeoFencingAsync() = " + error);
}
});
Unfortunately, I’ve been trying to debug this issue for the last several days but to no avail. Does anyone have a clue as to what the issue may be?
Thanks!!