HarmonyOS Health Service Kit运动健康服务检查/请求授权无回调问题?

如题:HarmonyOS Health Service Kit运动健康服务检查/请求授权无回调问题?

阅读 624
1 个回答

1、接口调用前,需先使用init方法进行初始化,没有回调的问题请确认是否已调用init方法。https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/health-api-healthstore-V5\#section1571935817328

2、步数通过日常活动数据进行开放,如果需要获取步数数据,需要申请“日常活动数据”权限。

参考链接:https://gitee.com/harmonyos\_samples/health\_-service\_-kit\_-sample-code/blob/master/entry/src/main/ets/common/bean/AuthManagement.ets\#L12

3、应用也可以参考官方实例代码。https://gitee.com/harmonyos\_samples/health\_-service\_-kit\_-sample-code