[英]wkwebview with location services
Ive been experimenting with swift and wanted to try out the wkwebview. 我一直在试验swift并想尝试wkwebview。 Ive built an app and it all works correctly but the problem is that the webpage that i load into my wkwebview uses google maps and requires location services, so the javascript should prompt a message saying "this app requires your location information".
我已经构建了一个应用程序,它一切正常,但问题是我加载到我的wkwebview的网页使用谷歌地图,并需要位置服务,所以javascript应提示一条消息说“这个应用程序需要您的位置信息”。 The swift app wkwebview doesnt display any message doesnt display my google maps either.
swift应用程序wkwebview不显示任何消息也不显示我的谷歌地图。 If i visit the url with the safari browser it prompts the location message and also in uiwebview on ios 7 it promps that message.
如果我使用safari浏览器访问url它会提示位置消息,并且在ios 7上的uiwebview中它会提示该消息。 Anyone else come accross this and know a solution?
还有其他人来这个并知道解决方案吗?
In iOS 8, you need to have a key in your Info.plist
that the system can use to prompt for location usage. 在iOS 8中,您需要在
Info.plist
中有一个密钥,系统可以使用该密钥来提示位置使用情况。 In your case you want to add a key/value pair with key NSLocationWhenInUseUsageDescription
. 在您的情况下,您希望使用密钥
NSLocationWhenInUseUsageDescription
添加密钥/值对。 The value of that pair will be shown in the first popup, from the system, asking if your app can access location services. 该对的值将显示在系统的第一个弹出窗口中,询问您的应用是否可以访问位置服务。 Then Google Maps will be allowed to pop up its own alert.
然后,谷歌地图将被允许弹出自己的警报。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.