本文介绍了如何以编程方式打开“设置"隐私> iOS 11+中的位置服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果locationServicesEnabled返回false,则提示用户启用其定位服务.以下网址适用于10.0+版本,可将用户重定向到设置"应用,然后直接重定向到位置服务"屏幕:

If locationServicesEnabled return false, I'm prompting the user to enable their Location Services. The following URL works for 10.0+, redirecting the user to the Settings app and directly to the Location Services screen:

URL(字符串:"App-Prefs:root = Privacy& path = LOCATION")

URL(string: "App-Prefs:root=Privacy&path=LOCATION")

但是,这在iOS 11中不起作用.它会打开设置"应用程序,但不会深入到定位服务".谁知道iOS 11+的新URL是什么?

However this doesn't work in iOS 11. It opens the Settings app, but doesn't drill down to the Location Services. Anyone knows what's the new URL for iOS 11+?

推荐答案

Apple在此链接.不幸的是,如果您使用其他URL(例如您尝试使用的URL),则会使您的应用程序被App Store拒绝.

Apple published a list of URLs which they explicitly allow at this link. Unfortunately if you use other URLs (such as the one you are trying to use) this can get your app rejected from the App Store.

简短的回答:您不能在不违反App Store规则的情况下做自己想做的事情.

Short answer: You cannot do what you are trying to do without breaking the App Store rules.

这篇关于如何以编程方式打开“设置"隐私> iOS 11+中的位置服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 06:39