hbuilder APP 定位提示苹果审核不通过

APP已经提交给苹果进行审核了,今天看看审核结果,居然挂了,给了几点问题,其中有一点就是关于定位的问题:

Your app uses location services but does not clarify the purpose of its use in the location modal alert. Apps that collect, transmit, or use location data must notify and obtain the user’s consent prior to accessing this data.

Please see attached screenshots for details.

Next Steps

To resolve this issue, please specify why the app is requesting the user’s location in the location permission modal alert

意思就是你提示的内容中需要告诉用户获取用户的位置是用来干嘛的,而默认打包的app中是没有说明的,说明就是一个location,如下图:

attachment-8104624644346239896Screenshot-0205-161520.png

在hbuilder的启动页面中,也没用看到有类似的设置,后面终于找到了相关的设置信息:

直接打开hbuilder的代码视图,直接改代码进行设置即可,搜索frameworks这个节点,在下面增加如下内容:

"plistcmds": [
                  "Set :NSLocationWhenInUseUsageDescription 根据您的位置信息,您可随时掌握所在位置周边房产的行情。",
                  "Set :NSLocationAlwaysUsageDescription  根据您的位置信息,您可随时掌握所在位置周边房产的行情。"
                ]

image.png

切记,需要打包后才能看到效果,通过这种方式就可以提示了。

当然在APP中还有很多需要提示的地方,比如打开相机,访问相册等等,也是可以做到的

权限列表如下:

“plistcmds”: [
“Set :NSContactsUsageDescription 说明读取用户通讯录的原因”,
“Set :NSMicrophoneUsageDescription 说明使用麦克风的原因”,
“Set :NSPhotoLibraryUsageDescription 说明读取用户相册的原因”,
“Set :NSCameraUsageDescription 说明使用用户相机的原因”,
“Set :NSPhotoLibraryAddUsageDescription 说明向用户相册添加图片的原因”,
“Set :NSLocationAlwaysUsageDescription 说明持续获取用户地理位置的原因”,
“Set :NSLocationWhenInUseUsageDescription 说明使用用户地理位置的原因”
]

更多权限:

通讯录 NSContactsUsageDescription
麦克风 NSMicrophoneUsageDescription
相册 NSPhotoLibraryUsageDescription
相机 NSCameraUsageDescription
添加图片到相册 NSPhotoLibraryAddUsageDescription
持续获取地理位置 NSLocationAlwaysUsageDescription
使用时获取地理位置 NSLocationWhenInUseUsageDescription
蓝牙 NSBluetoothPeripheralUsageDescription
语音转文字 NSSpeechRecognitionUsageDescription
日历 NSCalendarsUsageDescription

参考文章:https://www.cnblogs.com/liuq1991/p/8399479.html

猜你喜欢

转载自blog.csdn.net/u010889990/article/details/79552345