Location 服务问题纪录
来源:互联网 发布:金蝶免费进销存软件 编辑:程序博客网 时间:2024/05/17 05:12
iOS定位的两个键NSLocationWhenInUseUsageDescription和:NSLocationAlwaysUsageDescription问题纪录
Apple文档对这两个键的描述为:
NSLocationWhenInUseUsageDescription
NSLocationWhenInUseUsageDescription (String - iOS) describes the reason why the appaccesses the user’s location normally while running in the foreground. Includethis key when your app uses location services to track the user’s currentlocation directly. This key does not support using location services to monitorregions or monitor the user’s location using the significant location changeservice. The system includes the value of this key in the alert panel displayedto the user when requesting permission to use location services.
This key is required when you use the requestWhenInUseAuthorization method of the CLLocationManager class to request authorization for locationservices. If the key is not present when you call the requestWhenInUseAuthorization method without includingthis key, the system ignores your request.
This key is supported in iOS 8.0 and later. If your Info.plist file includes both thiskey and the NSLocationUsageDescription key, the system uses thiskey and ignores the NSLocationUsageDescription key.
NSLocationAlwaysUsageDescription
NSLocationAlwaysUsageDescription (String - iOS) describes the reason why the app accesses the user’slocation information. Include this key when your app uses location services ina potentially nonobvious way while running in the foreground or the background.For example, a social app might include this key when it uses locationinformation to track the user’s location and display other users that arenearby. In this case, the fact that the app is tracking the user’s locationmight not be readily apparent. The system includes the value of this key in thealert panel displayed to the user when requesting permission to use locationservices.
This key is required when you use the requestAlwaysAuthorization method of the CLLocationManagerclass to request authorization for locationservices. If this key is not present and you call the requestAlwaysAuthorization method, the systemignores your request and prevents your app from using location services.
This key is supported in iOS 8.0 and later. If your Info.plist file includes both thiskey and the NSLocationUsageDescription key, the system uses thiskey and ignores the NSLocationUsageDescription key.
即使用定位服务时,需要在plist文件中添加两个键中的一个:NSLocationAlwaysUsageDescription 和NSLocationWhenInUseUsageDescription,并在CLLocationManager 类的实例中调用两个方法中的一个requestAlwaysAuthorization 和requestWhenInUseAuthorization 。
- Location 服务问题纪录
- 问题纪录
- $location服务
- Location Services and Maps Programming Guide 纪录
- Ajax历史纪录问题
- ios开发问题纪录
- 工作问题纪录
- Location---Location服务之Geocoder
- Location---Location服务之LocationManager
- Location服务分析
- Location服务之Geocoder
- Location服务之LocationManager
- 地理位置服务(Location Service)
- Location服务之Geocoder
- Location服务之LocationManager
- Location服务之LocationManager
- Location服务之Geocoder
- Location服务之LocationManager
- PAGE_FAULT_IN_NONPAGED_AREA解决
- 关于cocoapods安装
- zoj 3010 The Lamp Game
- Objective C定义私有方法
- UVA 11775 Unique Story(LCS [LIS] + BIT)
- Location 服务问题纪录
- traincascade.cpp
- mac安装/升级java并配置环境变量
- 【南大软院大神养成计划:第八天】Sublime Text信仰初养成(一)
- Android.mk的用法和基础
- opencv学习笔记-线性空间滤波
- Android基础学-1
- 面试之C++题目汇总
- 关于特征选择