Skip to content

feat(analytics-react-native): add appLifecycles plugin#1789

Draft
daniel-graham-amplitude wants to merge 5 commits into
mainfrom
SDK-45-react-native-app-state
Draft

feat(analytics-react-native): add appLifecycles plugin#1789
daniel-graham-amplitude wants to merge 5 commits into
mainfrom
SDK-45-react-native-app-state

Conversation

@daniel-graham-amplitude
Copy link
Copy Markdown
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Jun 2, 2026

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Note

Low Risk
Optional analytics enrichment with no auth or data-model changes; behavior is covered by unit tests including subscription teardown.

Overview
Adds appLifecyclePlugin to @amplitude/analytics-react-native, exported from the package entry point. The enrichment plugin listens to React Native AppState and emits [Amplitude] Application Opened when the app becomes active and [Amplitude] Application Backgrounded when it goes to background; it logs if AppState is missing and cleans up via remove() or legacy removeEventListener.

The Expo example wires add(appLifecyclePlugin()) instead of the browser page-view plugin and drops the previous autocapture init options. Unit tests cover setup, tracking, pass-through execute, teardown, and the unavailable-AppState path.

Reviewed by Cursor Bugbot for commit a8054d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 2, 2026

SDK-45

@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as draft June 2, 2026 23:27
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 58.31 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 131.96 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 208.94 KB (0%)

Base automatically changed from SDK-45-react-native-autocapture-hacking to main June 3, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant