Error loading javascript google maps sdk on iOS


#1

Hi,

I get this google maps exception when I try to use javascript google maps with a client id on a iOS device:

Google Maps API error: UnauthorizedURLForClientIdMapError: https://developers.google.com/maps/documentation/javascript/error-messages#unauthorized-url-for-client-id-map-error

Your site URL to be authorized: file:///private/var/mobile/Containers/Bundle/Application/C6B8565C-4A69-4F9D-AFEC-CED61BD6CD54/HelloWorld.app/www/index.html

I’ve tried to register this url (file:///private/var/mobile/Containers/Bundle/Application/*) in the Google Console but it doesn’t work…

Any help is welcome!
Thanks!


#2

Is it intentional that you are using the premium Google Maps for Work? Seems licencing for this is only available on domain basis with http or https, and inside a Cordova app there really is no domain and files are served directly from memory.


#3

Hi, i have similar error on ios, works fine on android, can u suggest how to fix this

This IP, site or mobile application is not authorized to use this API key. Request received from IP address .*.., with referer: http://localhost:8080/var/containers/Bundle/Application/18D58633-0A01-44CB-B02E-32EC826211FA/myJiran.app/www/index.html For more information on authentication and Google Maps JavaScript API services please see: https://developers.google.com/maps/documentation/javascript/get-api-key*