获取安全地理位置信息接口的实现

获取安全地理位置信息接口的实现

HarmonyOS
2024-08-07 09:36:32
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
智体美劳全发展
public async getVerifiedSecureLocation(priority: trustedAppService.LocatingPriority): Promise<string> {
  try {
    await this.initSecureLocationAttestContext();
    const secureLocation = await trustedAppService.getCurrentSecureLocation(this.timeout, priority);
    /**
     * The best practice is to complete the secure location verification on the server.
     * The reference code is provided here.
     */
    await this.verifySecureLocation(secureLocation);
    return JSON.stringify(secureLocation.originalLocation);
  } catch (err) {
    throw new Error((err as BusinessError).message);
  }
}
分享
微博
QQ
微信
回复
2024-08-07 11:58:48
相关问题
HarmonyOS 安全地理位置
1240浏览 • 1回复 待解决
如何获取当前地理位置
696浏览 • 0回复 待解决
HarmonyOS 位置信息获取demo
1014浏览 • 1回复 待解决
MySQL 如何按照地理位置排序?
3794浏览 • 1回复 待解决
HarmonyOS 获取位置信息报错
1243浏览 • 1回复 待解决
HarmonyOS 位置信息设置及跳转
1186浏览 • 1回复 待解决
HarmonyOS 位置信息访问权限始终允许
3098浏览 • 1回复 待解决