Google Maps

More
12 Aug 2021 11:15 #3745 by graziano.ribichesu@gmail.com
Hello, I created the google maps api key to be able to use the service on the Vtenext app I also entered the key limitations on the domains used. But by doing so I can't use it on the app. If I use the app with app.vtecrm.net I can authorize this domain and it works but not with the native app for android or ios. Anyone know how to fix? Thank you

Please Log in to join the conversation.

More
13 Aug 2021 17:23 - 13 Aug 2021 17:29 #3746 by dende
Replied by dende on topic Google Maps
Hi Graziano,
you have to set an override so the app fetch the setted key.
To do so, create a new JS file in modules/Touch/overrides and write this code inside:
(function() {
 
	if (Vtecrm && Vtecrm.app) {
 
		if (window.google && window.google.maps) {
			delete window.google.maps;
			window.google = {
				maps: { 
					Map: function() {}
				},
			};
		}
 
		var head = document.getElementsByTagName('head')[0];
		var script = document.createElement('script');
		script.setAttribute('type', 'text/javascript');
		script.setAttribute('src', 'https://maps.googleapis.com/maps/api/js?libraries=panoramio,places&key=MY_GOOGLE_APIKEY');
		head.appendChild(script); 
 
	}
})();

Replace with the correct api key before saving the new file.
Then, logout and login into APP.

On next release there are no need to do this.
Thanks
Last edit: 13 Aug 2021 17:29 by dende.

Please Log in to join the conversation.

More
19 Aug 2021 19:10 - 19 Aug 2021 19:27 #3748 by graziano.ribichesu@gmail.com
sorry the file name for the override to create is: Geolocalization.js
thank you
Last edit: 19 Aug 2021 19:27 by graziano.ribichesu@gmail.com.

Please Log in to join the conversation.

Time to create page: 0.119 seconds