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

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

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);
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
分享
微博
QQ
微信
回复
2024-08-07 11:58:48


相关问题
HarmonyOS 安全地理位置
608浏览 • 1回复 待解决
HarmonyOS 位置信息获取demo
422浏览 • 1回复 待解决
MySQL 如何按照地理位置排序?
3209浏览 • 1回复 待解决
HarmonyOS 获取位置信息报错
665浏览 • 1回复 待解决
HarmonyOS 位置信息设置及跳转
485浏览 • 1回复 待解决
HarmonyOS 位置信息访问权限始终允许
756浏览 • 1回复 待解决