简体   繁体   English

iOS 应用程序安装后未显示在“设置”应用程序中

[英]iOS app not show in Settings app after install

I have an iOS app, which requests location permissions.我有一个 iOS 应用程序,它请求位置权限。 If the user accepts, everything works fine (of course).如果用户接受,一切正常(当然)。 But if the user doesn't accept and then manually triggers a localisation, he get the dialog provided by Apple to change the settings for the app in the Settings-App.但是,如果用户不接受然后手动触发本地化,他会得到 Apple 提供的对话框,以在 Settings-App 中更改应用程序的设置。

But if the user clicks on Settings , it just opens the Settings-App without jumping to the settings of my App.但是如果用户点击Settings ,它只会打开 Settings-App 而不会跳转到我的应用程序的设置。 The app is also not listed in the Settings-App mainscreen, but can be found under Privacy -> Location Services .该应用程序也未在 Settings-App 主屏幕中列出,但可以在Privacy -> Location Services下找到。

But once you accept the location (or any other) permissions, the app appears in the Settings and the links work fine.但是,一旦您接受位置(或任何其他)权限,该应用程序就会出现在“设置”中,并且链接可以正常工作。

NSLocationAlwaysAndWhenInUseUsageDescription is included in the pList. NSLocationAlwaysAndWhenInUseUsageDescription包含在 pList 中。

Any ideas on how to guarantee the to appear in the Settings-App mainscreen?关于如何保证出现在“设置-应用程序”主屏幕中的任何想法?

try to check current location permission and if it's declined show custom alert with this button action尝试检查当前位置权限,如果它被拒绝,则使用此按钮操作显示自定义警报

  guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else { return }
                if UIApplication.shared.canOpenURL(settingsUrl) {
                    UIApplication.shared.open(settingsUrl)
                }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM