微信 api scope is not declared in the privacy agreemen
时间: 2023-10-31 13:57:03 浏览: 381
codeblocks中报错:'to_string' was not declared in this scope解决方案
5星 · 资源好评率100%
根据报错信息"errMsg: “getLocation:fail the api need to be declared in the requiredPrivateInfos field in app.json/ext.json”和资料,这个报错信息是因为微信小程序的API需要在app.json或ext.json的requiredPrivateInfos字段中声明。而且根据资料,今年7月份更新了API地理位置相关接口的要求,需要在调用前进行准入申请并在app.json中配置权限。你可以在官方文档中查看小程序接口权限相关设置配置信息,并在项目的app.json中添加相关权限配置。这样,你就可以成功获取到位置信息了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [微信小程序报错“getLocation:fail the api need to be declared in the requiredPrivateInfos field in ...](https://blog.csdn.net/Pakho_Yip/article/details/128344697)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文