I have a big problem with this and I’m little annoyed by how much informations about this getUserLocation() i have found, and none of it worked. All i need is to get longtitude and latitude by cellular or wifi, nothing else, if there is any other way than getUserLocation, I’m OK with that.
When i run this in my phone it says Current location is unknown.
myMap = native.newMapView( 20, 20, 300, 220 ) function callMap() if(myMap ~= nil) then local currentLocation = myMap:getUserLocation() if currentLocation.errorCode ~= nil then native.showAlert("Jeeez it doesnt work again",currentLocation.errorMessage, {"OK"}) else native.showAlert("errorCode is nil which is good","...", {"OK"}) end else native.showAlert("Map is nil","...", {"OK"}) end end timer.performWithDelay( 3000, callMap )
If you can make your app run in background you can do this. But somehow corona doesn’t support background state apps. anyways im finding other ways to do this. you can do this by, once your app recognise an wifi connection, your function for getting your location will trigger thus, making your location be known.
If you can make your app run in background you can do this. But somehow corona doesn’t support background state apps. anyways im finding other ways to do this. you can do this by, once your app recognise an wifi connection, your function for getting your location will trigger thus, making your location be known.