diff --git a/zh-cn/application-dev/device/sensor-guidelines.md b/zh-cn/application-dev/device/sensor-guidelines.md index bae53e67dc9b2f0943d550918342056a812e17cd..6259723f5680f363646aca21d9341c6a22435622 100644 --- a/zh-cn/application-dev/device/sensor-guidelines.md +++ b/zh-cn/application-dev/device/sensor-guidelines.md @@ -34,40 +34,52 @@ 1. 获取设备上传感器的数据,需要在“config.json”里面进行配置请求权限。具体如下: ``` - ”reqPermissions“:[ - { - "name":"ohos.permission.ACCELEROMETER", - "reason"":"", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.GYROSCOPE", - "reason"":"", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.ACTIVITY_MOTION", - "reason"":"ACTIVITY_MOTION_TEST", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - { - "name":"ohos.permission.READ_HEALTH_DATA", - "reason"":"HEALTH_DATA_TEST", - "usedScene":{ - "ability": ["sensor.index.MainAbility",".MainAbility"], - "when":"inuse" - } - }, - ] + "reqPermissions": [ + { + "name": "ohos.permission.ACCELEROMETER", + "reason": "", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.GYROSCOPE", + "reason": "", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.ACTIVITY_MOTION", + "reason": "ACTIVITY_MOTION_TEST", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + }, + { + "name": "ohos.permission.READ_HEALTH_DATA", + "reason": "HEALTH_DATA_TEST", + "usedScene": { + "ability": [ + "sensor.index.MainAbility", + ".MainAbility" + ], + "when": "inuse" + } + } + ] ``` 2. 持续监听传感器数据变化。