简体   繁体   English

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

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

I would like to requests the user's permission to use location services while using the app, Allow Once or Don't allow.我想请求用户在使用应用程序时允许使用位置服务,允许一次或不允许。

enter image description here在此处输入图像描述

I only have code in ViewController.swift because I build the app with Ruby on Rails.我在 ViewController.swift 中只有代码,因为我在 Rails 上使用 Ruby 构建应用程序。

Which property list key I should use and how?我应该使用哪个属性列表键以及如何使用?

You need to call locationManager for this:您需要为此调用locationManager

locationManager.requestAlwaysAuthorization() 

To request "always" location access as well as:请求“始终”位置访问以及:

 locationManager.requestWhenInUseAuthorization()

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

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