问题描述
我的应用程序要求用户当前位置向他显示谷歌地图中特定位置的方向
My app requires users current location to show him direction to a particular location in google map
以下是在网页上显示位置的代码 -
[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]]]];
该应用使用 NSLocationAlwaysUsageDescription 和 NSLocationWhenInUseUsageDescription
The app declares support for location in .plist by using NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
[locationManager requestAlwaysAuthorization];
}
[locationManager startUpdatingLocation];
Apple拒绝了该应用,原因如下
Apple rejected the app with following reason
您的应用声明支持
中的UIBackgroundModes键中的位置您的Info.plist文件但仍未声明
需要持久位置的任何功能。声明支持
位置的应用程序Info.plist文件中的UIBackgroundModes键必须具有需要持久位置的功能
。
Your app declares support for location in the UIBackgroundModes key in your Info.plist file but still does not declare any features that require persistent location. Apps that declare support for location in the UIBackgroundModes key in your Info.plist file must have features that require persistent location.
具体来说,我们注意到路线功能不需要
持久性位置信息,因为它不包含
精细导航。
Specifically, we noticed that the Directions feature does not require persistent location information, since it does not include turn-by-turn navigation.
任何帮助将不胜感激,在此先感谢。
Any help will be appreciated, Thanks in Advance.
推荐答案
您只需从<$ c中删除位置支持$ c> UIBackgroundModes info.plist中的键
You just remove the location support from UIBackgroundModes
key in info.plist
因为你只能使用 UIBackgroundModes
当您的应用在后台时想要获取位置时的位置。
As you must only use UIBackgroundModes
for location when you want to fetch location when your app is in background.
在您的应用声明 NSLocationAlwaysUsageDescription
中 NSLocationWhenInUseUsageDescription
就够了。
In your app declaration of NSLocationAlwaysUsageDescription
and NSLocationWhenInUseUsageDescription
is enough.
这篇关于Apple Binary被拒绝(2.16)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!