Securing google map API, in cordova and web
-
Hi all,
I am using quasar-google-maps for my project(Web, Android, iOS), which is working fine without API restrictions.
It’s working in the web with HTTP Referrer restriction. But, in mobile device it’s showing error, I tried SHA1 restrictions for android. I am not sure if there anything needed to add in config.xml or not?
If anyone has secured api keys in android, please share some thought on this.
Thanks
-
-
@dobbel I am using cordova, and getting RefererNotAllowedMapError
-
in web you can always restrict the API usage to the domain from the google console, but with cordova you can’t do that. how about loading the map from your backend
-
how about loading the map from your backend
Or you could try this:
https://github.com/mapsplugin/cordova-plugin-googlemaps -
@dobbel Thanks I will try it, and check if it solves the security issue.
My current plugin working fine in Android too when I remove the restriction (SHA1) from the API console. May be Cordova specific plugin solve the issue. I will test and update
Thanks
-
@suleiman_as got it, but I am not understanding how to implement interactive google map from backend
-
This post is deleted! -
This post is deleted! -
@suleiman_as I am facing problem with android apps, PWA is not a solution for me
In browsers it’s working perfectly. I also tried cordova-plugin-googlemaps, unfortunately that’s also not working in my project. Only a empty map area is rendering, nothing is appearing, no console errors.
-
You could always try some other map library, these WILL work everywhere.
https://github.com/vue-leaflet/Vue2Leaflet
https://github.com/ghettovoice/vuelayers/