Project: titanium
Issue TIMOB-20217: iOS: Ti.Geolocation.hasGeolocationPermission()  and Ti.Geolocation.getCurrentPosition() are not working on IOS 7
h6.Issue Description Geolocation popup permission is not triggered by Ti.Geolocation.hasGeolocatinPermission() Ti.Geolocation.hasGeolocatinPermission() does not work on iOS 7. It returns true before permission has been determined. Once it is determined it does not return the right value. Ti.Geolocation.requestLocationPermissions() never calls the callback on iOS 7. h6.TestCase # Create a new Alloy default Application # Open views/index.xml # Replace the inside with the next code: {code}	{code} # Open controllers/index.js # Replace the inside with the next code: {code} $.win.open(); function checkPermission(){	if(Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_WHEN_IN_USE)){	Ti.API.info("APP HAS PERMISSION");	}else{	Ti.API.info("APP DOES NOT HAVE PERMISSION");	requestPermission();	} } function requestPermission(){	Ti.API.info("REQUESTING PERMISSION");	Ti.Geolocation.requestLocationPermissions(Titanium.Geolocation.AUTHORIZATION_WHEN_IN_USE,function(e){	Ti.API.info("INSIDE CALLBACK");	if(e.success){	Ti.API.info("PERMISSION GRANTED");	}else{	Ti.API.info("PERMISSION DENIED");	}	}); } function checkRequestPermission(){	checkPermission(requestPermission); } function getCurrentPosition(successHandler,errorHandler){	Ti.Geolocation.getCurrentPosition(function(result){	if (result.error) {	Ti.API.info("GetCurrentPosition Error");	}else{	Ti.API.info("GetCurrentPosition returned" + JSON.stringify(result));	}	}); } {code} #open the tiapp.xml file and add the next lines inside ios/plist/dict {code} NSLocationWhenInUseUsageDescription Testing Location in use {code} # Run h6.Steps to Reproduce # Press "Check Location Permission" button which calls Ti.Geolocation.hasLocationPermissions(). It should return true and you should see "APP HAS PERMISSION" output. # Press "Request Geolocation Permission" which calls Ti.Geolocation.requestLocationPermissions() You should see "REQUESTING PERMISSION" in your output. # Third button calls Ti.Geolocation.getCurrentPosition() to get users current position which is what triggers geolocation permission popup to show. If you grant permission in the popup then press "Check Location Permission" button again and you should see "APP DOES NOT HAVE PERMISSION" followed by "REQUESTING PERMISSION". This also happens if you refuse permission.
Story points: 3