After upgrading to cordova 11 from cordova 9, I am unable to open a google maps URI (On Button click Cordova app should open Google maps with the co-cordinates)
What worked in cordova 9:
var coord = lat ',' lon;
window.open(`comgooglemaps://${coord}?q=${coord}`, `_system`);
Ref: https://developers.google.com/maps/documentation/urls/ios-urlscheme
Now, this does nothing. No errors or logs.
Working config: Cordova 9
, cordova-ios 5.1.1
Current config: Cordova 11
, cordova-ios 6.2.0
CodePudding user response:
Try to use geo
instead
var coord = lat ',' lon;
window.open('geo://' coord, `_system`);
Or
window.open("http://maps.apple.com/?q=" coord, '_system');
CodePudding user response:
My issue was with the installed InAppBrowser plugin.
I've previously done as they suggested:
window.open = cordova.InAppBrowser.open;
But this no longer seems to work. As soon as I changed the code to use InAppBrowser explicitly:
window.cordova.InAppBrowser.open(`comgooglemaps://${coord}?q=${coord}`, _system);
it started working again.