-
28 Nov 2012 5:53 AM #1
Unanswered: GEO Location problem on homescreen
Unanswered: GEO Location problem on homescreen
Hi!
I walked into the problem of my geolocation breaking when the app is added to homescreen.
I googled around and found some other guys with the same problem.
One solution seemed to be not to add the meta:
When device uses IOS 6.Code:<metacontent="yes"name="apple-mobile-web-app-capable"/>
Is there any other solution to this problem?
And how do I remove that meta from my sencha app, only if the user agent header contains "ios 6"?
-
30 Nov 2012 7:49 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
This code from the API docs:
works on both my iPhone 5 and iPad 3 both having iOS 6.0.1 and web app is added to homescreen.Code:var geo = Ext.create('Ext.util.Geolocation', { autoUpdate : false, listeners : { locationupdate : function (geo) { alert('New latitude: ' + geo.getLatitude()); }, locationerror : function (geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { if (bTimeout) { alert('Timeout occurred.'); } else { alert('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.
-
30 Nov 2012 8:46 AM #3
I have a similar code and sometimes(yes, sometimes.. sometimes hanging) it works when the first call is made to
But I also have a button which enables the user to make another call to updateLocation whenever the user wants.Code:geo.updateLocation()
That means the second to infinite number of calls is made from the button.
In iOS 6 the first automatic call sometimes goes through without hanging.
In iOS 6 the second to infinite call never works, it just hangs. (the application itself seems to work fine)
In iOS 5 all calls works every time.
I've tried this on the following devices:
iPhone 5 (2 different devices)
iPhone 4S
iPad 2
the new iPad
Samsung Galaxy S2
Samsung Galaxy Tab 10.1
It works perfectly fine for all devices except the iPhone 5 when added to homescreen.
When not added to homescreen it works in iPhone 5 as well.
Here are two other sites adressing the same issue.
http://stackoverflow.com/questions/12503815/ios-6-breaks-geolocation-in-webapps-apple-mobile-web-app-capable
and
http://www.elevatedgis.com/blog/2012/09/21/ios-6-geolocation-and-local-data-storage/
Maby you just tried to make one call with your iPhone 5?
I appreciate your help and if you actually got it working with more than one call I'd love to test your exakt code to see if I can make that running.


Reply With Quote