简体   繁体   English

要求新的应用程序许可

[英]Ask for New App Permission

I added a feature in my app that requires the background location permission on ios. 我在应用程序中添加了一项功能,该功能需要ios上的后台位置许可。 How do I re-request the location permission to allow 'Always' vs 'While Using'? 如何重新请求位置许可以允许“始终”与“正在使用”?

Clarification: My app already requests the 'While Using' permission level. 澄清:我的应用程序已请求“使用时”权限级别。 With the new feature I need users to up the permission to be 'Always'. 有了新功能,我需要用户批准“始终”权限。 However, right now when installing the update over a pre-existing app, ios isn't promiting the higher level permission and the only way to change it is by going into the Settings app. 但是,现在在通过现有应用程序安装更新时,ios不允许更高级别的权限,唯一的更改方法是进入“设置”应用程序。

Add to the /platforms/ios/{project}/{project}-Info.plist file these lines: 将这些行添加到/platforms/ios/{project}/{project}-Info.plist文件中:

<key>NSLocationAlwaysUsageDescription</key>
<string>[App Name] would like to access your location when running.</string>

For 'While Using' your key has to be: NSLocationWhenInUseUsageDescription . 对于“使用时”,您的密钥必须为: NSLocationWhenInUseUsageDescription

The way I solved this was to check if the permission is not set to 'Always'. 我解决此问题的方法是检查权限是否未设置为“始终”。 Then if it's not, explain to the user why it needs to be set to 'Always' and then linking them to their settings to change it. 然后,如果不是,请向用户说明为什么需要将其设置为“始终”,然后将其链接到其设置以进行更改。

As far as I can tell there is no real way to re-trigger asking for a higher permission on iOS. 据我所知,没有真正的方法可以重新触发,要求在iOS上获得更高的权限。

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

相关问题 iOS应用不会要求位置许可 - iOS app doesn't ask for location permission 申请通知权限注册后(不仅仅是应用程序启动后) - Ask for Notification permission After sign up (not just after app starts) “应用程序必须在安装时请求基本的读取权限” - “The app must ask for a basic read permission at install time” 应用程序不询问位置服务许可whenInUse在安装时? - App doesn't ask location service permission WhenInUse when installation? iOS Swift4 没有在应用程序上请求许可 - iOS Swift4 Didn't Ask for Permission on App 这个应用程序如何立即请求后台位置权限? - How does this app ask for background location permission immediately? 在iOS 8中要求获得本地通知的权限,但仍然拥有iOS 7应用程序支持 - Ask for Permission for Local Notifications in iOS 8, but still have the App Support iOS 7 为什么我的 iOS 应用程序不要求用户访问相机的权限? - Why my iOS app does not ask user permission to access camera? IONIC 2-每当应用打开时,地理位置请求或许可 - IONIC 2 - GeoLocation ask or permission every time when app open UIImagePickerController不问权限? - UIImagePickerController not ask permission?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM