这个代码,也是前台一切正常,但是切换后台后,一直返回相同的 坐标数据。 wx.startLocationUpdateBackground({ type: 'gcj02', interval: 2000, // 2秒间隔 isHighAccuracy: true, foregroundService: { // 必须配置 notificationId: 1, notificationTitle: '轨迹记录中', notificationContent: '正在后台记录您的运动轨迹' }, success: () => { console.log('后台定位启动成功') const _locationChangeFn = function(res) { console.log('location change', res) } wx.onLocationChange(_locationChangeFn) //wx.onLocationChange(this.onLocationUpdate.bind(this)) }, fail: (err) => { } }) },
已经审核通过startLocationUpdateBackground接口,但是挂在后台定位不生效?wx.startLocationUpdateBackground({ success: () => { console.log('后台定位启动成功'); this.backgroundLocationStarted = true; this.startLocationChangeListener(); resolve(); },
09-21