PostHog / PostHog/posthog-android
Support scroll and swipe events
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 90
- Forks
- 49
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 61
Description
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:
https://github.com/PostHog/posthog-js-lite/blob/ae60ef46be7eaa3560ca1657f504c6498a5499dc/posthog-react-native/src/PostHogProvider.tsx#L80-L92
This has to implement something similar.
This applies to:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Android autocapture implementation and compare its event handling with the referenced PostHogProvider.tsx and PostHogAutocaptureEventTracker.swift files. Read the Android gesture detector guidance and determine how MotionEvent.ACTION_DOWN and ACTION_UP can distinguish touches, scrolls, and swipes. Done means Android autocapture reports scroll and swipe events separately from touch events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- analytics, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100