The updates that the PGB team did to PGB yesterday have supposedly fixed geolocation issues. Give a new build a try!
I can confirm that: with the new cli-7.1.0 and the latest version of cordova-plugin-geolocation (no spec) it works.
Today I tried to get geolocation working with the presumed update 7.1.0. My app is ID 2015611. Now I get a completely different error. Path of an png not found. Before I used 7.1.0 I at first got the error that geolocation plugin could not be installed because there was not the correct 6.3.0 Android Phonegap Version while there was found something like 6.1.2 (do not remember correctly because of so many attempts to get it working). Then I used 7.0.1 and cordova-plugin-geolocation at "2.4.3" for android. APK was built without any error. But geolocation did not work with native app WoBinIch, while the web app works fine. So I tried 7.1.0 because of the above message mentioning a yesterdays update. Now it did not build the apk because of a missing png path.
Update: I tried with 7.1.0 and geolocation without spec. Did not work.
Check your config.xml file for a icon src=icon.png tag near the end of the icon declarations. You should be able to just search for “icon.png”.
Odd. I don't have any problem with this. Code builds fine.
<icon src="icon.png" />
<splash src="splash.png" />
Also, cordova-plugin-geolocation without spec works for me.
Now using 7.1.0 in ~10 apps.
For me neither 4.0.1 or no spec works on cli-7.1.0 as of today.
I am back to 2.4.3 which does work.
iOS 11.2.2 on an iPad Pro. Did both tests just before I posted.
Then after compiling with 2.4.3 I was asked to verify location on the device and all was OK
I'm not on 11.2.2 yet. Will test tomorrow.
Update: Geolocation doesn't work within an iframe with an https URL on iOS 11.2.2 (it did before). It works if the iframed page is accessed directly via Safari.
Yes in native Safari it prompts me to approve location when the app starts. This does not happen in the Cordova compiled app when the plugin is not 2.4.3.
So the supposed fix in CLI 7.x is not working with the plugin IMHO.
I'm not sure what you mean by "supposed fix".
cli-7.1.0 is a completely new version of Cordova and related platform-specific parts with lots of changes overall. In terms of iOS, not the least adapation to XCode 9 and iOS 11.
The only real difference I can think of (off the bat) is that the latest version of cordova-plugin-geolocation lacks the location permissions, as the plugin will be overridden if existing geolocation support is detected (which should be the case). Supposedly those permissions should be triggered run-time.
This fixed it for me (latest version of the plugin):
<!-- Required for use of location -->
<edit-config file="*-Info.plist" target="NSLocationWhenInUseUsageDescription" mode="merge">
<string>The app needs to be able to locate the phone</string>
It's no longer part of the plugin. See "iOS Quirks" here cordova-plugin-geolocation
Re: supposed fix: Somebody mentioned a fix to 7.0.1. Because I could not find a newer 7.0.1 or a 7.0.2 I guessed that the mentioned fix could be 7.1.0.
OK, but it's not a fix, it's a major upgrade.
Even so, try this:
Upgrade to cli-7.1.0 and the latest plugins to get the latest code overall. That fixes numerous Cordova problems.
Apply the fix I mention in the previous post, as the plugin no longer performs the mentioned setting (if it ever did).