收藏
回答

调用wx.getPrivacySetting,开发者工具不报错,真机报错?

开发者工具不报错,手机调试报错:MiniProgramError

wx.getPrivacySetting is not a function

TypeError: wx.getPrivacySetting is not a function

at getPrivacySetting (pages/pages/index/index.js:18:8)

at ui.<anonymous> (WASubContext.js:1:441969)

at ui.c.__callPageLifeTime__ (WASubContext.js:1:441762)

at (WASubContext.js:1:452688)

at (WASubContext.js:1:417595)

at (WASubContext.js:1:453137)

at (WASubContext.js:1:417595)

at (WASubContext.js:1:458289)

at (WASubContext.js:1:417595)

at Function.or (WASubContext.js:1:458955)

回答关注问题邀请回答
收藏

1 个回答

  • MISS
    MISS
    2023-08-28

    需要加上判断 if(wx.getPrivacySetting){//写隐私逻辑} 低版本是没有这个api的


    2023-08-28
    有用
    回复 2
    • Css🎈
      Css🎈
      2023-08-28
      this.resolvePrivacyAuthorization is not a function这个是怎么回事呢?
      2023-08-28
      回复
    • MISS
      MISS
      2023-08-29回复Css🎈
      resolvePrivacyAuthorization是wx.onNeedPrivacyAuthorization的回调函数 必须调用了wx.onNeedPrivacyAuthorization拿到回调才能调用
      2023-08-29
      回复
登录 后发表内容