Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default [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:
    Code:
    Ext.device.Geolocation.getCurrentPosition({    success: function(position) {
            console.log(position.coords);
        },
        failure: function() {
            console.log('something went wrong!');
        }
    });
    When using iPhone4s with iOS6 it works fine in the browser. It prompts fine and everything.
    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.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Also tried without success:

    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();
    We can look into what's going on to see if it's our bug or another iOS 6 bug.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Also tried without success:

    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();
    We can look into what's going on to see if it's our bug or another iOS 6 bug.
    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.

  4. #4
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    86
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      0  

    Default


    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

  5. #5
    Touch Premium Member hotdp's Avatar
    Join Date
    Nov 2010
    Location
    Denmark
    Posts
    603
    Vote Rating
    14
    hotdp will become famous soon enough

      0  

    Default


    Hi,
    Is the only workaround to disable gps if its added to homescreen?

  6. #6
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    86
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      0  

    Default


    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.