Results 1 to 3 of 3

Thread: GEO Location problem on homescreen

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
      0  

    Default 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:
    Code:
    <metacontent="yes"name="apple-mobile-web-app-capable"/>
    When device uses IOS 6.

    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"?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    This code from the API docs:

    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();
    works on both my iPhone 5 and iPad 3 both having iOS 6.0.1 and web app is added to homescreen.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    Sweden
    Posts
    7
    Vote Rating
    0
      0  

    Default

    I have a similar code and sometimes(yes, sometimes.. sometimes hanging) it works when the first call is made to
    Code:
    geo.updateLocation()
    But I also have a button which enables the user to make another call to updateLocation whenever the user wants.

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •