简体   繁体   English

如何在Swift中为WKWebView启用位置服务?

[英]How to enable Location Services for a WKWebView in Swift?

My Browser app uses WKWebView but when I try to visit a website that needs to use Location Services (like Google Maps, for example), it doesn't work. 我的浏览器应用程序使用WKWebView,但是当我尝试访问需要使用位置服务的网站(例如Google Maps)时,它不起作用。

I have searched for a way to fix it and came across this question . 我一直在寻找解决问题的方法,并遇到了这个问题 I tried to add the string on the answer to the question to my Info.plist but it doesn't resolve the issue. 我试图将问题答案上的字符串添加到我的Info.plist中,但不能解决问题。

How can I fix this? 我怎样才能解决这个问题?

Thanks, 谢谢,

PastaCoder PastaCoder

我不确定如何操作,但是昨天NSLocationWhenInUseUsageDescription在Info.plist中为NSLocationWhenInUseUsageDescription添加字符串确实可行,并且问题已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM