PostHog / PostHog/posthog-android

Support scroll and swipe events

Open
#566 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.