ioscordovacordova-pluginsios10w3c-geolocation

PhoneGap Geolocation is blocked in iOS10


My Phonegap app leverages the (Cordova 3.8) webviews 'W3C Geolocation API'. Since upgrading from iOS 9.x to iOS 10 (beta) however, using

navigator.geolocation.getCurrentPosition(...)

now returns an error:

Access to geolocation was blocked over insecure connection to http://localhost. ERROR(2): Origin does not have permission to use Geolocation service

I do not currently use the Cordova Whitelist Plugin. Would using that help or is there a simpler fix?


Solution

  • I added the geolocation plugin instead of using the default Webview geolocation API