鸿蒙5.0开发【module.json5文件中的requestPermissions配置如何填写】应用运维
这里的reason和usedScene如何填写,有参考资料吗?目前在网上找到的资料表示这两个字段不是必填的,但是如果真不填的话在DevEco Studio(Build Version: 4.1.3.600, built on February 22, 2024)上会编译报错:The reason and usedScene attributes are mandatory for user_gra
·
问题场景
这里的reason和usedScene如何填写,有参考资料吗?目前在网上找到的资料表示这两个字段不是必填的,但是如果真不填的话在DevEco Studio(Build Version: 4.1.3.600, built on February 22, 2024)上会编译报错:The reason and usedScene attributes are mandatory for user_grant permissions.
参考示例如下:
// module.json5
"requestPermissions": [
{
"name": "ohos.permission.APP_TRACKING_CONSENT",
"reason": "$string:app_tracking_consent_reason",
"usedScene": {
"abilities": [
"FormAbility"
],
"when": "always"
}
}
]
更多推荐
所有评论(0)