【问题标题】:iOS App build Rejected :- Location Permission modal alert descriptioniOS App build Rejected :- 位置权限模式警报描述
【发布时间】:2019-04-18 06:04:10
【问题描述】:

当位置在设备中关闭时出现此对话框。我的应用被拒绝,因为这个对话没有包含任何关于应用为什么需要位置的描述。

我在 info.plist 中添加了关于位置使用描述的所有键。但它不占用描述。这个对话不是由我们的应用处理的,也不知道它是从哪里出现的。

请大家帮忙解释一下为什么这里没有显示描述。?提前致谢

【问题讨论】:

  • 它只是在 PLIST 中。他们不是在谈论那个警告框中的描述。
  • 如果连你都不知道对话是怎么处理的,我们怎么知道和帮助?
  • 您需要确定对话框的来源;检查您正在使用的任何第 3 方框架/模块。
  • @Desdenova 这仅在设备设置中禁用该位置或警报正确显示时显示
  • @Paulw11 这仅在设备设置中禁用该位置或警报正确显示时显示

标签: ios swift core-location


【解决方案1】:

这是一个 iOS 对话框(而且相当糟糕;所有单词都不应该大写)。

我建议您对拒绝提出上诉,并解释这是一个您无法控制的 iOS 对话框;

如果位置服务被禁用,Apple Maps 会显示完全相同的对话框

【讨论】:

  • 感谢@Paulw11 的帮助
【解决方案2】:

使用这些键添加此描述

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Description.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Description.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Description.</string>

Apple 在许可方面进行了许多疯狂的更改。如果您要求 NSLocationAlwaysUsageDescription。您仍然需要对 NSLocationWhenInUseUsageDescription 进行描述。

【讨论】:

  • 我附上了info.plist的截图
  • 您的 info.plist 文件似乎没问题。但是警报来自您的应用程序。这不是苹果第一次发出警报。
  • 只有在设备设置中关闭位置时才会发生这种情况。否则对话会正确显示
【解决方案3】:

几天前我们的应用也发生了这种情况,我们的应用因您提到的类似原因被拒绝。该消息不能是通用消息。因此,您可以显示您的自定义屏幕,您可以在其中提及您需要位置权限的确切原因,然后显示此弹出窗口。

<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>MyApp uses your location to provide the list of products serviceable at your location and for better recommendation</string>
<key>NSLocationAlwaysUsageDescription</key>
    <string>MyApp uses your location to provide the list of products serviceable at your location and for better recommendation</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>MyApp uses your location to provide the list of products serviceable at your location and for better recommendation</string>

编辑:

在您的应用程序中的某个地方,您可能会将此自定义消息与警报控制器一起使用

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:**your custom message** preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction *allowAction = [UIAlertAction actionWithTitle:@"Settings" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
    }];
    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
        for (void(^ completion)(NSNumber * __nonnull status) in self.callbacks) {
            completion(@(kCLAuthorizationStatusDenied));
        }
    }];
    [alertController addAction:cancelAction];
    [alertController addAction:allowAction];

    [someViewController presentViewController:alertController animated:animated completion:nil]; 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-03
    • 1970-01-01
    • 2018-11-18
    • 2017-07-12
    • 1970-01-01
    • 2017-08-24
    • 2015-01-29
    • 1970-01-01
    相关资源
    最近更新 更多