简体   繁体   English

位置服务

[英]Location services

I have in plenty of Core Location based apps that before triggering the code for location services an alert pop up and warns user that the app is going to use their current location. 我有很多基于Core Location的应用程序,这些应用程序在触发位置服务的代码之前会弹出警报,并警告用户该应用程序将使用其当前位置。 Is this a in-built feature of Core Location or we need to implement it before calling API? 这是Core Location的内置功能,还是我们需要在调用API之前实现它?

Yes. 是。 It's built-in. 它是内置的。 As of iOS4 you can modify the text body for this alert specifically for your app. 从iOS4开始,您可以专门针对您的应用修改此警报的文本正文。

Follow this link http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125 单击此链接http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125

and find purpose property in the doc. 并在文档中找到purpose属性。

This is built-in. 这是内置的。 When you try to call core location methods, if the user hasn't allowed your app to do so before, the OS will automatically pop an alert. 当您尝试调用核心定位方法时,如果用户之前不允许您的应用允许这样做,则操作系统将自动弹出警报。

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

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