收藏
回答

addPhoneContact接口苹果11手机失效?

wx.addPhoneContact

微信版本:8.0.26

wx.getSetting({
            success(res) {
                if (!res.authSetting['scope.addPhoneContact']) {
                    wx.showModal({
                        title'通讯录授权',
                        content'请打开通讯录权限,否则无法正常提供功能使用',
                        success:(res) => {
                            if (res.confirm) {
                                wx.authorize({
                                  scope'scope.addPhoneContact',
                                  success() {
                                    wx.addPhoneContact({
                                        firstName: name,
                                        mobilePhoneNumber:phone,
                                        organization:companyName,
                                        email,
                                        workAddressState:arr[0],
                                        workAddressCity:arr[1],
                                        workAddressStreet:addres
                                    })
                                  }
                                })
                            } else if (res.cancel) {
                                wx.showToast({
                                  title'授权失败',
                                })
                            }
                        },
                    })
                } else {
                    wx.addPhoneContact({
                        firstName: name,
                        mobilePhoneNumber:phone,
                        organization:companyName,
                        email,
                        workAddressState:arr[0],
                        workAddressCity:arr[1],
                        workAddressStreet:addres
                    })
                }
            }
        })
回答关注问题邀请回答
收藏

1 个回答

  • Demons
    Demons
    2022-07-27

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2022-07-27
    有用
    回复
登录 后发表内容