Skip to content

docs(messaging): update token registration examples#9102

Merged
mikehardy merged 3 commits into
invertase:mainfrom
wanxiankai:docs/update-messaging-modular-token
Jul 18, 2026
Merged

docs(messaging): update token registration examples#9102
mikehardy merged 3 commits into
invertase:mainfrom
wanxiankai:docs/update-messaging-modular-token

Conversation

@wanxiankai

@wanxiankai wanxiankai commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #8710 by updating the Cloud Messaging token registration guidance to use the modular API consistently.

  • Clarifies that iOS auto-registration is enabled by default before the getToken(messaging) example
  • Keeps the defensive registerDeviceForRemoteMessages(messaging) call in the device token example and labels it as optional and a no-op if already registered
  • Updates the iOS unregistered error messages and firebase.json schema description from messaging().registerDeviceForRemoteMessages() to registerDeviceForRemoteMessages(getMessaging())

Verification

  • git diff --check
  • node -e "JSON.parse(require('fs').readFileSync('packages/app/firebase-schema.json','utf8')); console.log('firebase-schema.json ok')"
  • rg -n "messaging\\(\\)\\.registerDeviceForRemoteMessages|messaging\\(\\)\\.getToken|firebase\\.messaging\\(\\)\\.registerDeviceForRemoteMessages" docs/messaging packages/messaging packages/app/firebase-schema.json
  • npx --yes prettier@3.8.3 --check docs/messaging/notifications.mdx packages/app/firebase-schema.json

Note: I attempted to run a targeted clang-format --style=Google -n -Werror packages/messaging/ios/RNFBMessaging/RNFBMessagingModule.mm check, but clang-format is not installed in this local environment.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the documentation and error messaging for Cloud Messaging token registration. By emphasizing the default auto-registration behavior on iOS and updating references to the modular API, the changes improve clarity for developers and ensure consistency across the codebase.

Highlights

  • Documentation Updates: Updated the Cloud Messaging token registration documentation to clarify that iOS auto-registration is enabled by default, removing the unnecessary manual call to registerDeviceForRemoteMessages in the example.
  • API Consistency: Standardized error messages and schema descriptions to use the modular registerDeviceForRemoteMessages(getMessaging()) API instead of the legacy messaging() syntax.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown
Contributor

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 documentation, schema descriptions, and iOS error messages to use the new modular API syntax registerDeviceForRemoteMessages(getMessaging()) instead of the legacy namespace syntax. Feedback suggests correcting a minor redundancy and punctuation issue in the schema description.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/app/firebase-schema.json Outdated
Comment thread packages/app/firebase-schema.json Outdated
Comment thread docs/messaging/notifications.mdx
@wanxiankai
wanxiankai marked this pull request as ready for review July 13, 2026 15:37
@wanxiankai
wanxiankai requested a review from mikehardy July 13, 2026 15:37

@mikehardy mikehardy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is great, thank you!

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.81%. Comparing base (1bad118) to head (1c80bc2).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9102      +/-   ##
============================================
+ Coverage     58.66%   65.81%   +7.15%     
- Complexity     1617     1832     +215     
============================================
  Files           503      497       -6     
  Lines         39180    38761     -419     
  Branches       5807     5787      -20     
============================================
+ Hits          22981    25505    +2524     
+ Misses        14800    11780    -3020     
- Partials       1399     1476      +77     
Flag Coverage Δ
android-native 62.94% <ø> (+9.37%) ⬆️
e2e-ts-android 59.67% <ø> (+9.67%) ⬆️
e2e-ts-ios 62.75% <0.00%> (+8.80%) ⬆️
e2e-ts-macos 50.00% <ø> (+8.52%) ⬆️
ios-native 62.75% <0.00%> (+8.80%) ⬆️
jest 49.58% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy

mikehardy commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

There is no way this PR could have affected java formatting but that's what failed a moment ago in CI, which is why I'm extra glad I think java formatting flakiness was just fixed with recent merge:

...but there is a real iOS failure which I'm fixing and pushing now, then this can merge (after lint passes)

@mikehardy
mikehardy merged commit 5ab3ffa into invertase:main Jul 18, 2026
19 of 20 checks passed
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.

[📚] Cloud Messaging getToken() not updated to modular format

2 participants