Hi all, we’re having an error with the geolocation plugin on our build on ionic pro, but only for iOS.
The message that’s returned with the error is “Origin does not have permission to use Geolocation service”
It’s worth noting as well, that we don’t receive any prompt to grant the app permission to use user location.
It’s also in the docs for Ionic Pro as a supported plugin.
I find it strange that it would be missing the “Origin” header only on Ionic Pro for iOS, since it works on Ionic Pro for Android, Android APKs and iOS IPAs
I can’t discern the URL being requested in my dev environment, the plugin seems rather sophisticated and may not be calling a URL until it’s on the Ionic Pro environment, in which case I can’t debug it to find out.
From their own docs
"Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs. There is no guarantee that the API returns the device’s actual location."
Since iOS 10 it’s mandatory to add a NSLocationWhenInUseUsageDescription entry in the info.plist.
NSLocationWhenInUseUsageDescription describes the reason that the app accesses the user’s location. When the system prompts the user to allow access, this string is displayed as part of the dialog box. To add this entry you can pass the variable GEOLOCATION_USAGE_DESCRIPTION on plugin install.
Why not? Ionic Pro builds as you would do locally.
Follow these instructions here to debug the problem in Safari dev tools: Remote Debug your Ionic App · ionic.zone Look at the console and network tabs for errors.
I got Problems with the Geolocations Plugin too, after updating from Ionic View to Ionic Pro. Trying to use it results in freezing of the Ionic Pro app, testing the same code via Xcode and Deploy it directly works fine. So something is wrong for sure. I didnt know that its possible to debug Apps running inside Ionic Pro over Safari, i will have a look at that method.
Edit: if i use link the same project to the old Ionic View again and do ionic upload, it works fine too.
Hey did somebody got a solution regarding this? Im having the exact same problem. No popup to allow location on iOS and getting the geolocation.getcurrentlocation throws an error : Origin does not have permission to use Geolocation service