下面是iOS7和iOS8申請定位權限時的不一樣:php
或者這樣:html
if([CLLocationManager locationServicesEnabled])ios
{web
self.locationManage = [[[CLLocationManager alloc] init] autorelease];api
self.locationManage.delegate = self;微信
self.locationManage.distanceFilter = 200;app
self.locationManage.desiredAccuracy = kCLLocationAccuracyBestForNavigation;post
//kCLLocationAccuracyBest;優化
if (SYSTEM_VERSION >= 8.0) {ui
//使用期間
[self.locationManage requestWhenInUseAuthorization];
//始終
//or
[self.locationManage requestAlwaysAuthorization]
}
}
另外也提供下新增下面的代理方法:
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status
{
switch (status) {
case kCLAuthorizationStatusNotDetermined:
if ([self.locationManage respondsToSelector:@selector(requestAlwaysAuthorization)])
{
[self.locationManage requestWhenInUseAuthorization];
}
break;
default:
break;
}
}
詳情見 https://app.yinxiang.com/l/ABarZZCJ2_dAd7B0ncWryoyV2bZ06fI1_WM
@interface AppDelegate()<CLLocationManagerDelegate>
{
UINavigationController *_navController;
CLLocationManager *_locationmanager;
}
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[UIApplicationsharedApplication].idleTimerDisabled = TRUE;
_locationmanager = [[CLLocationManager alloc] init];
[_locationmanager requestAlwaysAuthorization]; //NSLocationAlwaysUsageDescription
[_locationmanager requestWhenInUseAuthorization]; //NSLocationWhenInUseUsageDescription
_locationmanager.delegate = self;
//....
}
Reasons:
Hello,
We found the following rejection while reviewing your app. Please see more details below.
We found that your app uses a background mode but does not include the following battery use disclaimer in your Application Description:
"Continued use of GPS running in the background can dramatically decrease battery life."
It would be appropriate to revise your Application Description to include this disclaimer.
If your iTunes Connect Application State is Metadata Rejected, we do NOT require a new binary.
To revise the metadata:
- Log in to iTunes Connect
- Click on 「My Apps」
- Select your app
- Revise the desired metadata values
- Click 「Save"
- Once you’ve completed all changes, click the 「Submit for Review」 button at the top of the App Details page
Kind Regards,
The App Review Team
**************************************************************************
系列文章:老項目的#iPhone6與iPhone6Plus適配#(持續更新中,更新日期2014年10月12日 星期日 )
列表以下:
2.老項目的#iPhone6與iPhone6Plus適配#Icon適配
3.老項目的#iPhone6與iPhone6Plus適配#iOS8沒法開啓定位問題記起#解決方案#
4.老項目的#iPhone6於iPhone6Plus適配#iPhone6分辨率與適配
6.#iPhone6與iPhone6Plus適配#如何在Xcode 6中建立 PCH 文件
**************************************************************************
https://developer.apple.com/library/IOs/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html