iOS 6 breaks GeoLocation in webapps (apple-mobile-web-app-capable)

前端 未结 11 1806
无人及你
无人及你 2020-12-07 16:21

I have an app that does a simple textbook navigator.geoLocation.watchPosition(...) that works great in iOS 5.x both in Safari and as a web app (using apple-mobile-web-app-ca

相关标签:
11条回答
  • 2020-12-07 16:46

    This appears to be fixed under iOS 6.1! It wasn't in the recent betas, but today's final 6.1 release seems to be good with my testing.

    0 讨论(0)
  • 2020-12-07 16:48

    here is a video of me replicating the bug and demonstrating a work around. This bug appears to exist weather you use the web app meta tag or not.

    http://youtu.be/ygprgHh6LxA

    Update: 121212 - IOS 6.1 Beta 3 testing shows the bug is still not resolved...

    Update: 122012 - IOS 6.1 Beta 4 testing shows the bug is still not resolved...


    Update: 031113 - Replication Example

    Okay, it is a simple issue to replicate in just a few seconds. I feel it is not a safari, but an IOS issue. It’s almost as if Google wrote the bios for the IOS to meet the WC3 html geo location spec and took it with them when IOS6 kicked them off the bus. Using an IOS device go here:

    http://uc.myaesc.com/geoloctestorig.htm

    Click start, watch should return result almost every second. Then click the Google link to leave this page. Then user browser back button to return Click start. Watch will return 1 to 3 records and hang. Minimize safari (home button) and then restore (safari icon); stops hanging

    That's it. until it does not hang, the issue remains.

    Mark

    UPDATE:

    IOS 7.1 fixed the issue...

    0 讨论(0)
  • 2020-12-07 16:48

    I'm having the same problem. Looks like watchPosition is simply failing out after the first position is received. I haven't found a work around yet, but I wanted to confirm that I was experiencing issues.

    Using these samples: http://www.w3schools.com/html/html5_geolocation.asp

    I get expected results on ios5 but ios6 drops the ball with watchPosition.

    0 讨论(0)
  • 2020-12-07 16:49

    This is FINALLY fixed in iOS7 beta (beta 2 is all I've tested)!

    0 讨论(0)
  • 2020-12-07 16:50

    This is definitely a bug but I found a work around. You aren't going to like this but at least it will get your web app working again. You need to examine the User Agent header and if it contains "iPhone OS 6" then do not use:

    <meta content="yes" name="apple-mobile-web-app-capable" />
    

    Yes, this means that it won't be a true web app and you will get the Safari header and footer bars. But at least it will make your app work again from the home screen. You can see how this works by going to my site www.nextbus.com.

    Note that it appears that Google ran into this problem. Try going to maps.google.com and then adding the web app to your homescreen. The geolocation will work for it but you will indeed see the ugly Safari header and footer bars.

    Please complain loudly to Apple!

    0 讨论(0)
提交回复
热议问题