Skip to content

docs(Analytics): Adding examples for v23#8970

Open
Bilal-Abdeen wants to merge 6 commits intoinvertase:mainfrom
Bilal-Abdeen:patch-12
Open

docs(Analytics): Adding examples for v23#8970
Bilal-Abdeen wants to merge 6 commits intoinvertase:mainfrom
Bilal-Abdeen:patch-12

Conversation

@Bilal-Abdeen
Copy link
Copy Markdown
Contributor

@Bilal-Abdeen Bilal-Abdeen commented Apr 12, 2026

Description

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • [x ] Yes
  • My change supports the following platforms;
    • [x ] Android
    • [x ] iOS
    • [x ] Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • [ x] No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:


Note

Low Risk
Low risk documentation-only change that updates code samples for the newer v22+ modular Analytics API. Risk is limited to potential user confusion if examples are incorrect or inconsistent with the actual SDK.

Overview
Updates docs/analytics/usage/index.md to split multiple snippets into version-specific examples: <= v21 using instance methods (e.g., analytics().logEvent) and >= v22 using the modular API (e.g., getAnalytics() + logEvent(analytics, ...)).

Also adjusts related examples for logSelectContent, getAppInstanceId, setAnalyticsCollectionEnabled, setConsent, and replaces the Other/Web debug guidance for v22+ with setLogLevel('debug'|'verbose') instead of globalThis.RNFBDebug.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

@Bilal-Abdeen is attempting to deploy a commit to the Invertase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to include code examples for the modular API introduced in React Native Firebase version 22. The review feedback identifies a syntax error in the logEvent example and incorrect API usage for setting log levels, providing suggestions to ensure consistency with the modular API.

Comment thread docs/analytics/usage/index.md Outdated
Comment thread docs/analytics/usage/index.md Outdated
Bilal-Abdeen and others added 3 commits April 13, 2026 09:16
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 12, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Copy Markdown
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm let me think on this one - I appreciate the PR and we definitely can use all the help we can get keeping documentation up to date, but I don't like the cognitive load implied by a big bunch of conditionals "if RNFB < this version" etc

I think I'd prefer to just update them all to the modular APIs, and have one note at the top indicating that the examples all use the modular APIs vs the deprecated namespaced ones since those are slated for removal shortly.

Copy link
Copy Markdown
Contributor Author

@Bilal-Abdeen Bilal-Abdeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed old examples (before v22)

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.

2 participants