1***@qq.com
1***@qq.com
  • 发布:2024-04-02 14:15
  • 更新:2024-09-09 14:55
  • 阅读:122

uni.startLocationUpdateBackground is not a function app安卓端不存在api,请问大佬们有什么api替代?

分类:nvue

/**

  • 开始后台定位
    */
    function startBGLocation() {
    console.log("startBGLocation");
    if (ldata.bgStatus == 1) {
    return;
    }
    // 当前位置信息
    const startLocationFun = function() {
    uni.onLocationChange(function(res) {
    //开启成功
    ldata.bgStatus = 1;
    console.log(res, "eee");
    })
    }
    uni.startLocationUpdateBackground({
    type: 'gcj02',
    success: startLocationFun,
    fail: (error) => {
    //开启失败
    _startBGLocationError(error);
    }
    })
    uni.onLocationChangeError((error) => {
    _onLocationChangeError(error);
    })
    }
2024-04-02 14:15 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com

你这个是微信小程序的 app的是这个吧uni.startLocationUpdate

要回复问题请先登录注册