I have created an ios app (Xcode) with a single WebKit View component that loads an external website. This website tries to get the current geolocation with this Javascript: navigator.geolocation
.
This all works fine, but the problem is, I get 2 messages:
- First a message for the app: 'Allow "NameApp" to access your location while you are using the app?'
- Second a message for the webview: 'https://mywebsite.com would like to use your current location'.
I have seen similar questions about this issue, but they all went about a native/offline Cordova app. I have an online app in my Webview.
How can I prevent this double message? Or a workaround for this problem?
UIWebView
neither asks for location (which is good) but cannot find my location (which is bad) and I'm not sure the reason. – GrazierUIWebView
asks for location. When you navigate away from theUIWebView
and back, you get asked again. When you navigate away again and back, it does not ask. I've closed the app and tried it again, and I don't get asked. It looks like there might be some cache there which is nice. But after a longer period of time, you get asked again byUIWebView
. So far we've released as is, but still looking for a solution. – Grazier