-
17 Oct 2012 4:02 AM #1
[2.1.0-RC1] Save to home screen - Geolocation not working
[2.1.0-RC1] Save to home screen - Geolocation not working
Hi,
I have a web application that uses:
When using iPhone4s with iOS6 it works fine in the browser. It prompts fine and everything.Code:Ext.device.Geolocation.getCurrentPosition({ success: function(position) { console.log(position.coords); }, failure: function() { console.log('something went wrong!'); } });
If I save the same application to homescreen. Nothing happens. It will not prompt, succes or failure is never run.
I have tried with higher timeout etc. nothing works?
If I call it in init it works. If I call it on itemtap etc. it does not work.
-
17 Oct 2012 5:42 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,684
- Vote Rating
- 435
Also tried without success:
We can look into what's going on to see if it's our bug or another iOS 6 bug.Code:var geo = Ext.create('Ext.util.Geolocation', { autoUpdate : false, listeners : { locationupdate : function (geo) { Ext.Viewport.setHtml(geo.getLatitude() + ' : ' + geo.getLongitude()); }, locationerror : function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { if (bTimeout) { Ext.Viewport.setHtml('Timeout occurred'); } else { Ext.Viewport.setHtml('Error occurred'); } } } }); geo.updateLocation();Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Oct 2012 5:55 AM #3
Hi Mitchell,
Yes I started with that code with the same result.
What I have found out is that somehow the code is run twice!(also if I only execute the code once) And it only works the first time, the next time nothing happens.
So if you check if it is all ready run and return the position from before it "works". But not a very good solution if you are moving.
-
5 Dec 2012 11:16 AM #4
This bug is out of our control and appears to be Apples problem. Apps added to the homescreen will fail on GPS requests unless you strip out the "apple-mobile-web-app-capable" meta tag. This adds the browser chrome back around your app and is not a solution.
To test this comment out line #657 in core/Ext-more.js and re-add the application to the homescreen.
More Information can be found here http://stackoverflow.com/questions/1...eb-app-capable
-
10 Dec 2012 12:38 AM #5
Hi,
Is the only workaround to disable gps if its added to homescreen?
-
10 Dec 2012 10:43 AM #6
As far as I can tell it is out of our control at the moment. We really need apple to fix whatever is causing the problem. If I come across any more information I will make sure to get back to you.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote