So I have a React Native app, and when testing in iOS, on first launch it always asks for location while in use (within 1 second of opening). ie. "Allow XXX to access your location while you are using the app?" permission dialog.
I am using react-native-permissions for other stuff, but I've searched and searched my code and have 0 references to "geolocation","location","navigator",etc. Basically there no location code or geolocation code anywhere to be found.
Looking for help on how to diagnose this crazy issue. In my NPM modules, again nothing crazy there either that would depend on location. I've even deleted the "NSLocationWhenInUseUsageDescription" from info.plist and app still launches, doesn't crash and never prompts location dialog!
(This is on iOS 11.3)
Looking for advice.
Thanks
Check your Info.plist, you probably have either of these keys, or both:
NSLocationAlwaysAndWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
As a result iOS will prompt for location access as soon as you launch your app.
I have an iPhone GPS application that uses Google Maps SDK to show the user current location on a map within the app (my app does not open the Google Maps app).
The user can then mark points on the map based on their current location which is then saved to a database.
I can view my current location on my iPhone that I use for testing and I can also mark and submit points (lat/long coordinates). I am distributing the app app to another tester using Crashlytics but when they run the app on their phone they don't see their location marked on the map (no blue dot displayed of their current location). And when they mark a point on the map, the point is saved as 0,0 - the same as if you were to test the app on the emulator and no location has been set up.
I have deleted my app on my phone that was installed when I run it via Xcode and have installed the same version via Crashlytics I have sent them via Crashlytics. When I run it on my phone then I still see my location and can log the current location as the correct lat/long.
I have asked them to check if location services are enabled on their phone and they have said that they are.
Is there any reason that can cause them to not see their location on the map? I have also tested on my iPod Touch and I can even see my location on that. Its just the tester that does not see their location at all.
I am testing on an iPhone 4 and they are testing on an iPhone 5 - but I don't think this should make a difference? Also my iPod is the latest generation and that shows my location.
Has anyone else come across this situation and what could be the possible cause/fix?
So I'm working on a location-based iPhone app. I'm mainly testing on the iOS simulator, and as such using the Core Location Simulation. All good - I can pretend to be in New York or San Francisco or wherever.
Then I move to testing my app on my iPhone, with that checkbox still enabled. I go for a walk (in, like, the actual real world), pull out Google Maps, and realise that my actual, not-simulator iPhone is using a simulated location. In this instance my iPhone is stuck thinking that it's in London (where I live), but right central in Picadilly Circus, not where I am.
I get home, open up Xcode, and to make sure I've nailed down the cause (rather than just a weird GPS bug etc), change the 'default location' to Johannesburg. Unplug my phone, open Google Maps (and Foursquare, to be sure), same deal. Stuck in Johannesburg.
So it's definitely this panel here that's borked my phone, but I can't figure out how to reset it.
Things I've tried that don't seem to work:
changing 'default location' to 'none' & rerunning
disabling 'allow location simulation' & rerunning
So it seems once you've given your iPhone an arbitrary location to pretend to be in, just disabling that doesn't fix it.
Any ideas? I'm going travelling in a few days and really need my GPS to work!
While you have your device connected to the debugger there is a little button at the top of the debug panel. Right here:
Click on that and you can select 'don't simulate location', exit the app, and I think you'll be good to go.
I'm a little foggy too on how that relates to the location defined in the scheme and the location set in the simulator. I usually find it easier to set a location in the simulator itself rather than in the scheme (at least when testing in the simulator is possible) to avoid issues like this. In the simulator if you enter a location under 'Debug > Location > Custom Location...' while the simulator is on the springboard the location will persist between launches of the app and the simulator.
This has happened to me before, it was very strange and mysterious!
I don't remember how I fixed it, but: have you tried Reset Location & Privacy in the Settings app? If all else fails, I suspect Reset All Settings would maybe work.
As I try to remember, I think maybe hard rebooting the phone might also work (just turn it off, turn it back on).
just Reset Location & Privacy . turnoff location service . restart your phone .. turn on location service . try using google maps .. it work for me ..
The important step is the hard reset after resetting location settings. Not sure if you need to do anything in Xcode, but it is a good idea to select 'Don't simulate location'
Go back to Xcode (or whatever coding software you are using) and rerun the application, then select don't simulate location.
Goto Settings>Privacy>Location Services. Turn-Off Location Services. Restart the phone. Open Google maps. A popup will come to enable location service, click on the options given that will take you directly to Settings. If popup didn't appear in Google Maps, click on Mylocation button at the bottom. Enable Location services and get back to Google Maps. It re-enabled the real Location for me.
Go to Edit Scheme..., then select Run in left panel. In options, set Default Location under Core Location to None.
As suggested in this comment if you don't have Xcode handy, you can just power cycle the iPhone and this seems to be sufficient. You don't need to reset any settings. This worked this morning for my iPhone anyway, recalling it from a winter sojourn of Berlin.
I am preparing my PhoneGap/Cordova-based app for use on iOS 8. I am using Xcode 6 and PhoneGap/Cordova 3.6.3. My app requires location services permission.
iOS 8 is not storing or maintaining state on the location services. In fact, it's not asking the user for permission to access location services.
If you go to Settings>Privacy>Location>Bike Guide, you'll see that no setting is checked. If you check "Always" and leave Settings.app to enter Bike Guide.app, the setting is quickly lost (see screenshot) and Bike Guide.app cannot get the device's location.
How do you fix this?
Is it possible to mock a location when using Core Location Manager like you can in Android? I want to do this so we can see simulated behaviors when a user is a different location.
If you are using at least Xcode 4.2 and iOS SDK 5+, you can launch your app and in the simulator you can click the debug menu, then click the location option, the click custom location. You can then enter a custom latitude and longitude. They also have options for Freeway Drive, City Bicycle Ride, and City Run these all emulate the device moving.
You can definitely simulate location on the device if you run from Xcode. After the app compiles, installs, and starts running, find the "Debug Bar" at the bottom of the window (or just above the Console, if you have that showing). There is a small "Location" icon that reveals a menu of locations, plus an option to load a GPX file if you want something more complex. You can also edit your build scheme to include a default location in the Run phase (i.e., for every run, not just when you set the location with the menu in the Debug bar).
One thing to note, if you're using your personal device and not a dedicated development device: the custom location Xcode sets persists even after you disconnect from Xcode. So if you leave your desk with your phone, you may find it still thinks it's in whatever location you simulated; restarting will clear this setting, and allow you to use your device normally.