Apple Binary Rejected (2.16)

匿名 (未验证) 提交于 2019-12-03 07:50:05

问题:

My app requires users current location to show him direction to a particular location in google map

Below is the code to show location on web view-

[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]]]]; 

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 rejected the app with following reason

2.16 Details

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.

回答1:

You just remove the location support from UIBackgroundModes key in info.plist

As you must only use UIBackgroundModes for location when you want to fetch location when your app is in background.

In your app declaration of NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription is enough.



回答2:

Based on:

  • My app requires users current location to show him direction to a particular location in google map.
  • NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription
  • we noticed that the Directions feature does not require persistent location information, since it does not include turn-by-turn navigation

It looks like they're stating you shouldn't need location information unless the app is actually active. Since the location information is used to show the user the direction they need to head in, you should be able to simply adjust (with a little latency of course) when your app comes to the fore.

From Apple's documentation:

UIBackgroundModes (Array - iOS) specifies that the app provides specific background services and must be allowed to continue running while in the background.

These keys should be used sparingly and only by apps providing the indicated services. Where alternatives for running in the background exist, those alternatives should be used instead.

For example, apps can use the significant location change interface to receive location events instead of registering as a background location app.


That'd be my analysis though it's equally likely that the reviewer just had an argument with their significant other that morning, and is just being capricious :-) Nah, just joking, but it does sometimes seem to outsiders that the decisions they make are, shall we say, less than perfectly consistent.



回答3:

It's is not necessary to request the background mode to request the user's current location.

I would recommend to use NSLocationWhenInUseUsageDescription if you don't need to use the user's location in background. Users are more inclined to deny the user location authorization when they see NSLocationAlwaysUsageDescription because they think that reduce the device's battery



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!