Hi there,
I am using the following code to share the experience using the devices navigator. However, when the navigator window opens/closes, the input touch count bugs out. It thinks there is one extra touch, and keeps adding 1 each time the navigator opens and closes.
const shareExperience = () => {
// Check if the device supports navigator.share
if (navigator.share) {
navigator.share({
title: '<TITLE HERE>',
text: '<MESSAGE HERE>',
url: '<URL HERE>',
})
.catch((err) => {
console.error('Error sharing:', err)
})
} else {
// Fallback to SMS sharing
const smsMessage = encodeURIComponent('<MESSAGE HERE>')
const smsUrl = `sms:?body=${smsMessage}`
window.location.href = smsUrl
}
}
This is one part of the code that uses the touch count.
const updateRotation = (e) => {
console.log(`Touches = ${e.data.touchCount}`)
if (e.data.touchCount === 1) {
const touchDelta = e.data.positionChange.x
currentRotation += touchDelta * rotationSpeed * 10
Quaternion.set(world, targetContainer, rotation.makeYDegrees(currentRotation))
}
}
world.events.addListener(world.events.globalId, ecs.input.GESTURE_MOVE, updateRotation)
It works fine on Android but counts additional touches on iOS.