Apple Binary被拒绝(2.16)

Yog*_*dre 4 iphone objective-c ios ios8

我的应用程序要求用户当前位置向他显示谷歌地图中特定位置的方向

以下是在网页视图上显示位置的代码 -

[self.getDirectionsWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",currentLocation.coordinate.latitude,currentLocation.coordinate.longitude,self.projectLatitude,self.projectLongitude]]]];
Run Code Online (Sandbox Code Playgroud)

该应用程序通过使用NSLocationAlwaysUsageDescriptionNSLocationWhenInUseUsageDescription声明支持.plist中的位置

if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
        [locationManager requestAlwaysAuthorization];
    }
    [locationManager startUpdatingLocation];
Run Code Online (Sandbox Code Playgroud)

Apple拒绝了该应用程序,原因如下

2.16详情

您的应用程序在Info.plist文件的UIBackgroundModes键中声明了对位置的支持,但仍未声明任何需要持久位置的功能.声明支持Info.plist文件中UIBackgroundModes键位置的应用程序必须具有需要持久位置的功能.

具体来说,我们注意到Directions功能不需要持久的位置信息,因为它不包括精细导航.

任何帮助将不胜感激,在此先感谢.

Pan*_*dav 10

您只需从UIBackgroundModesinfo.plist中的密钥中删除位置支持

因为UIBackgroundModes当您的应用在后台时想要获取位置时,您只能使用位置.

在您的应用程序申报NSLocationAlwaysUsageDescription,并NSLocationWhenInUseUsageDescription就足够了.