offDeviceMotionChange不进回调
startDeviceMotionDetect() {
console.log('start device motion detect')
wx.startDeviceMotionListening({
interval: 'game',
success: ()=>{
console.log('device motion started succeed')
},
fail: (err)=>{
console.log('device motion started failed')
console.log(err)
},
})
},
stopDeviceMotionDetect() {
wx.stopDeviceMotionListening({
success: (res) => {
console.log('device motion detect stopped succeed')
},
fail: (err)=>{
console.log('device motion stopped failed: ' + err)
},
})
},
endDeviceMotionDetect() {
console.log('triggle offDeviceMotionChange')
wx.offDeviceMotionChange(()=>{
// 进不了这个回调
console.log('offDeviceMotionChange Callback')
})
},
onLoad() {
wx.onDeviceMotionChange((result) => {
console.log(result)
})
}
offDeviceMotionChange的回调无法正常触发