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

前端 未结 11 1844
无人及你
无人及你 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: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:

    
    

    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!

提交回复
热议问题