If your app requires location updates you need to enable the location access from Appilix’s advanced settings tab.
If it is still not working then:
- Go to the Integration Module 🔧.
- In the integration settings, enable Custom CSS & JS by toggling this option on.
- Then, navigate to the Custom JavaScript section ✍️.
- Paste the script code provided below into the custom JavaScript field. After pasting the code, make sure to save your changes 💾 by scrolling to the bottom and clicking the “Save” button.
Finally, rebuild the app 🛠️
If you need further assistance or run into any issues, our support team is always available to help you ☎️💬.
The script:
if ("geolocation" in navigator) {
navigator.geolocation.getCurrentPosition(function(position) {
// Successfully retrieved the location
console.log("Latitude: " + position.coords.latitude);
console.log("Longitude: " + position.coords.longitude);
}, function(error) {
// Failed to retrieve the location
console.error("Error Code = " + error.code + " - " + error.message);
});
} else {
console.error("Geolocation is not supported by this browser.");
}