收藏
回答

IOS authorize隐私授权弹窗前切换页面会连续返回?

const requestLocationAuth = async () => {
        try {
            const settings = await getSetting();
            const hasAuth = settings.authSetting['scope.userLocation'];


            if (hasAuth) {
                await getLocationFn();
            } else {
                const res = await authorize({
                    scope: 'scope.userLocation'
                });
                if (res.errMsg === 'authorize:ok') {
                    await getLocationFn();
                }
            }
        } catch (error) {
            showModal({
                title: '授权失败',
                content: '请在设置中授权获取地理位置权限',
                showCancel: false,
                success: () => openSetting()
            });
        }
    };

上述getLocationFn方法为封装的getLocation方法。IOS中,authorize弹窗前,返回上一个页面再进入,弹窗隐私点同意,后续返回都会连续返回两次
回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 该问答由AI生成
    01-22
    有用
登录 后发表内容