wx.getLocation need to be declared in the requiredPrivateInfos field in app.json/ext.json(env: Windows,mp,1.06.2301160; lib: 2.30.3)
自 2022 年 7 月 14 日后發(fā)布的小程序,使用以下8個地理位置相關(guān)接口時,需要聲明該字段,否則將無法正常使用。
文件app.json
?
全局配置 | 微信開放文檔微信開發(fā)者平臺文檔https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#requiredPrivateInfos
文件manifest.json?
uniapp設(shè)置requiredPrivateInfos
如下設(shè)置?
?
在mp-weixin?里設(shè)置就可以了
最后記得在小程序后臺去開通一下需要的地理位置接口,要不然正式環(huán)境不讓上線哦。開通理由正常填寫就是了,一般不會駁回。
我目前只用到一個,所以開通對應(yīng)的就行了文章來源:http://www.zghlxwxcb.cn/news/detail-454734.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-454734.html
到了這里,關(guān)于微信小程序報錯wx.getLocation need to be declared in the requiredPrivateInfos field in app.json的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!