Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support scroll and swipe events #303

Open
3 tasks
marandaneto opened this issue Nov 12, 2024 · 1 comment
Open
3 tasks

Support scroll and swipe events #303

marandaneto opened this issue Nov 12, 2024 · 1 comment

Comments

@marandaneto
Copy link
Member

marandaneto commented Nov 12, 2024

Description

https://posthog.com/docs/libraries/react-native#autocapture
Right now scrolls and swipes are considered touch, we can probably check if it's a scroll, a swipe, or else.
It's likely possible via heuristics or event metadata, such as the MotionEvent.ACTION_UP and MotionEvent.ACTION_DOWN on Android.
More ideas here https://developer.android.com/develop/ui/views/touch-and-input/gestures/detector

For RN specifically:

const onTouch = useCallback(
(type: 'start' | 'move' | 'end', e: GestureResponderEvent) => {
// TODO: Improve this to ensure we only capture presses and not just ends of a drag for example
if (!captureTouches) {
return
}
if (type === 'end') {
autocaptureFromTouchEvent(e, posthog, autocaptureOptions)
}
},
[captureTouches, posthog, autocaptureOptions]
)

This has to implement something similar.

This applies to:

  • Android - session replay
  • iOS - autocapture and session replay
  • RN - auto capture and session replay indirectly via Android and iOS
@marandaneto
Copy link
Member Author

RN can at least autocapture events such as touched a ScrollView
Where the component is <ScrollView ...></ScrollView>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant