Closed christian-hess-94 closed 1 month ago
I suggest you launch your app in XCode and carefully monitor the logs.
this is not a plugin issue. This an issue with your app or device settings.
thanks for the quick response! I'll run it and see if the logs can give any more info
After running the app and observing the logs we are receiving this error:
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization:
callback and checking authorizationStatus
first.
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization:
callback and checking authorizationStatus
first.
also this:
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization: callback and checking authorizationStatus first.
You are likely using some other plugin responsible for that.
Here is the entire logs of my demo app launching:
Plugin version: ^4.13.3
BTW, the latest version is 4.16.0
(see CHANGELOG)
we have updated it, but it did not fix the issue.
Yes we noticed after that we are using another plugin to detect for location permissions (which it is detecting fine)
Are you providing your logs here from the iOS Simulator?
yes exactly. We are running it in the iPhone 15 (17.2) simulator
You're aware of how you simulate location in the iOS Simulator with Features -> Location?
yes we have a custom location set
it also shows up in the xCode logs, those are the lat lng values we have set
yes we have a custom location set
I suggest you test with Features -> Location -> Apple.
we will test it here one sec
And if you've enabled Core Location [x] Allow Location Simulation
in your Launch Config, disable it.
will check here in a moment
just verified, it is turned to YES but it has been set to YES for the past 4 years (git blame)
Using GPX files is tricky. The GPX file can get "stuck" on a physical device requiring device restart if you don't do things correctly. You will also experience your phenomenon on other apps using location (eg: Google Maps, Apple Maps).
got it i'll try with all of the above in a moment.
also i think it didn't become clear but this issue is affecting our app in production as well, running on iphone devices. From what we were able to gather, all iphone devices are presenting this issue, it's not an one-off that happened with only one or two of our users
running the app with:
The new Privacy Manifest has nothing at all to do with Location Services.
affecting our app in production as well,
Whatever you're experiencing is not due to the plugin. I'm testing every day for over 10 years. None of the other thousands of users are reporting anything like this.
Yes after checking on the logs here I agree. We thought it was as the plugin is intrinsic to our app's function, as it controls the main feature that is provides (location tracking). I do appreciate you giving us pointers to check out what the issue could be.
Another question, before launching our MVP, we created multiple schemes (dev, stg) that are distributed to our internal testers prior to production release. Do you think it could be the reason for this issue? That somehow these new configurations / schemes could have de-configured the location tracking in the app in general, affecting prod as well?
LocationError: 0
means the plugin asked the OS "Can I please have the current location?", and the OS replied "Sorry, I have no location to give: I don't know where I am".
Another question, before launching our MVP, we created multiple schemes (dev, stg)...Do you think it could be the reason for this issue?
I doubt that. Unless you've somehow managed to distribute a Debug build with Core Location [x] Allow Location Simulation
.
LocationError: 0
And like I said, when you receive this error in your app, you'll likely experience it on every other app on the device (eg: Google Maps, Apple Maps).
doesn't that configuration also affect Release builds? as it's a global enabled/disabled config that affects all schemes and configs
LocationError: 0
And like I said, when you receive this error in your app, you'll likely experience it on every other app on the device (eg: Google Maps, Apple Maps).
just verified by opening the Apple Maps app in the same simulator and on the iPhone device we use for testing (11 - 17.2), and it shows the location fine, marker on the map and all. further points that the issue is a misconfiguration on our part here
After running my app with a GPX file on a physical device, I never trust my location. I always reboot my device (after re-launching with app with [ ] Allow Location Simulation
disabled.
got it i'll reboot it here
alright after doing all of that and relaunching the simulator, the location is being pinged again. Both with our manual trigger using the getCurrentPosition() call, and with the plugin's own internal HTTP flow.
however, the data is returning is_moving as false, even while the marker moves around. I will test in the device if this happen there as well, but could you know the reason for this? Again, this does not happen with android
I suggest you test in the simulator with Freeway Drive., not with your custom GPX file. The plugin determines the device is moving when it exits a 200 meter geofence around the last known location.
ah yes i was using freeway drive, you can see the leftmost pings are all on the freeway near the Apple location.
Also this is_moving issue has happened before before we pushed the app into production a few months ago. it has always presented itself this way. It wasn't a blocker for release the app to prod, which is why we never pursued it before
useSignificantChangesOnly: true,
is_moving is always false with that configuration.
Suddenly getting a location unknown error
I believe your issue here is solved.
Hello Chris, yes we have now verified that the app is working as intended! Spent the day doing a lot of debugging and driving around and was able to get a bunch of pings throught my route here. Also i got is_moving=true when setting useSignificantChange to off.
Thanks a lot for your help debugging this, I guess removing the Location Emulation flag did the trick!
SOLUTION: The issue was fixed when:
Allow Location Simulation
Your Environment
react-native -v
): 11.3.3Plugin config
Expected Behavior
We want to be able to use the plugin to automatically send location updates to provided URL We want to be able to manually retrive location data when running BackgroundGeolocation.getCurrentPosition()
Actual Behavior
The plugin is not sending the automatic location updates. Also when using mapbox, the GPS location marker does not appear rendered in the map, as if it were unavailable When running BackgroundGeolocation.getCurrentPosition (after running BackgroundGeolocation.ready()) we get the 0 error that stands for location unknown
Steps to Reproduce
At specific times, manually call BackgroundGeolocation.getCurrentPosition()
Context
I have recently added the App Privacy file that is now required in all new versions of iOS. The contents are below: