收藏
回答

wx.openSetting iphone6s,iphone7无效

iphone6s  iphone7无效,安卓的可以。


ios: 10.3.2    wechat:6.5.12

wechatlib:1.4.4

小程序编译:1.1.0


refLoadAuthorize:function(succ,fail){

    var that = this;

    if(wx.openSetting){

      console.log('wx.openSetting load');//这里可以打印出来,后面就没有反应,也不报错

    

      wx.openSetting({

        success: (res)=> {


          console.log('success',res);

          if (res.authSetting["scope.userInfo"]) {

            that.getUserInfo();


            if (typeof succ == 'function') succ();

          }

          else

          {

            if (typeof fail == 'function') fail();

          }


          if (res.authSetting["scope.userLocation"]){

            that.getLocation();

          }


        },

        fail :(res)=>{

          console.log('fail',res);

        },

        complete:(res)=>{

          console.log('complete',res);

        }

      });

    } else {

      console.log('不支持wx.openSetting');

      wx.showModal({

        title: '提示',

        content: "您的微信版本过低,不支持再次授权,请删除小程序重新打开,授权请点击‘允许’",

        showCancel: false,

        confirmText: '确定'

      });

    }

  },


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

4 个回答

  • 晨
    2017-07-29

    在Page的生命周期函数中调用目前有些问题,后续版本会修复。可以先setTimeout延时调用。

    2017-07-29
    有用
    回复
  • 算沙
    算沙
    2017-09-20

    是啊,就是这完成方式太过hack,让人纠结!

    2017-09-20
    有用
    回复
  • LEE
    LEE
    2017-09-19

    按照官方回复的可以完成。

    2017-09-19
    有用
    回复
  • 算沙
    算沙
    2017-09-19

    遇到同样的问题

    2017-09-19
    有用
    回复
登录 后发表内容