繁体   English   中英

xcode11 - 请求 ios 中的位置服务授权 13

[英]xcode11 - Requesting Authorization for Location Services in ios 13

我想请求用户在使用应用程序时允许使用位置服务,允许一次或不允许。

在此处输入图像描述

我在 ViewController.swift 中只有代码,因为我在 Rails 上使用 Ruby 构建应用程序。

我应该使用哪个属性列表键以及如何使用?

您需要为此调用locationManager

locationManager.requestAlwaysAuthorization() 

请求“始终”位置访问以及:

 locationManager.requestWhenInUseAuthorization()

暂无
暂无

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

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