I have an existing PhoneGap 1.3 application that does some geolocation that works fine in iOS 4 and 5. In iOS 6, getCurrentPosition almost always triggers a failure callback. After a failure, additional getCurrentPosition calls do not work either on success callbacks or in the event of a failure. I reduced the application to the following code, which demonstrates the same behavior as my full application.
document.addEventListener("deviceready", function() { console.log('deviceready!!!'); successCallback = function() { console.log('success!!!'); }; failureCallback = function() { console.log('failure!!!'); navigator.geolocation.getCurrentPosition(function() { console.log('success 2'); }, function() { console.log('failure 2'); }); }; navigator.geolocation.getCurrentPosition(successCallback, failureCallback); }, false);
When it fails, this is what I get in the log:
2012-09-24 16:26:46.576 MyAppName[7250:16703] [INFO] deviceready!!! 2012-09-24 16:26:56.582 MyAppName[7250:16703] [INFO] failure!!!
Nothing more.
Any ideas on where to go with this?
source share