Skip to content

Conversation

@OnestarLee
Copy link
Collaborator

@OnestarLee OnestarLee commented Oct 15, 2025

External Contributions

This project is not yet set up to accept pull requests from external contributors.

If you have a pull request that you believe should be accepted, please contact
the Developer Relations team developer-advocates@sendbird.com with details
and we'll evaluate if we can setup a CLA to allow for the contribution.

For Internal Contributors

[SBISSUE-20340](https://sendbird.atlassian.net/browse/SBISSUE-20340)

Description Of Changes

fireabase 22+ 이상 버전부터 Modular API로 변경되었습니다.
기존 namespaced api 와 modular api 둘다 지원이 가능하도록 구현하였습니다.
고객이 modular api를 사용하기 위해서는 import 구문 변경이 필요합니다

//namespaced api 
import RNFBMessaging from '@react-native-firebase/messaging';
//modular api
import * as RNFBMessaging from '@react-native-firebase/messaging';

Types Of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply_

  • Bugfix
  • New feature
  • Documentation (correction or otherwise)
  • Cosmetics (whitespace, appearance (ex) Prettier)
  • Build configuration
  • Improvement (refactor code)
  • Test

@codecov-commenter
Copy link

codecov-commenter commented Oct 15, 2025

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 10.89%. Comparing base (d685271) to head (083df0a).

Files with missing lines Patch % Lines
...e/src/platform/createNotificationService.native.ts 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
- Coverage   10.90%   10.89%   -0.02%     
==========================================
  Files         360      360              
  Lines        9001     9016      +15     
  Branches     2407     2419      +12     
==========================================
  Hits          982      982              
- Misses       8018     8033      +15     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@OnestarLee OnestarLee changed the title feat: enhance Firebase messaging module support for v22+ [SBISSUE-20340] feat: enhance Firebase messaging module support for v22+ Oct 15, 2025
@OnestarLee OnestarLee requested review from bang9 and Copilot October 15, 2025 02:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances Firebase messaging module support to accommodate both legacy namespaced API (v14) and the new modular API (v22+), allowing the codebase to work with both Firebase versions without breaking changes.

  • Added type definitions and detection logic for modular vs. namespaced Firebase messaging APIs
  • Updated all messaging service methods to support both API patterns through conditional execution
  • Maintained backward compatibility while enabling future Firebase version support

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@bang9 bang9 left a comment

Choose a reason for hiding this comment

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

요거 혹시 동작이 안되는게 있나요?
제가 확인했을때는 최신 버전에서 modular API 가 추가되기는 했지만, 백워드를 깬거같지는 않더라구요

// v14
import messaging from '@react-native-firebase/messaging';
const token = await messaging().getToken();

// v23
import messaging, { getMessaging, getToken } from '@react-native-firebase/messaging';

const token1 = await messaging().getToken();  // OK
const token2 = await getToken(getMessaging());  // OK
const token3 = await getMessaging().getToken();  // OK

@OnestarLee
Copy link
Collaborator Author

OnestarLee commented Oct 15, 2025

요거 혹시 동작이 안되는게 있나요? 제가 확인했을때는 최신 버전에서 modular API 가 추가되기는 했지만, 백워드를 깬거같지는 않더라구요

이게 동작은 되는데 deprecate 예정이고, 고객이 sentry에서 경고가 계속해서 노출된다고하여 수정하였습니다

@bang9
Copy link
Collaborator

bang9 commented Oct 15, 2025

요거 혹시 동작이 안되는게 있나요? 제가 확인했을때는 최신 버전에서 modular API 가 추가되기는 했지만, 백워드를 깬거같지는 않더라구요

// v14
import messaging from '@react-native-firebase/messaging';
const token = await messaging().getToken();

// v23
import messaging, { getMessaging, getToken } from '@react-native-firebase/messaging';

const token1 = await messaging().getToken();  // OK
const token2 = await getToken(getMessaging());  // OK
const token3 = await getMessaging().getToken();  // OK

이게 동작은 되는데 deprecate 예정이고, 고객이 sentry에서 경고가 계속해서 노출된다고하여 수정하였습니다

아하 그러네요, 화인 감사합니다!

@OnestarLee OnestarLee requested a review from bang9 October 16, 2025 00:51
Copy link
Collaborator

@bang9 bang9 left a comment

Choose a reason for hiding this comment

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

lgtm!

@OnestarLee OnestarLee added this pull request to the merge queue Oct 16, 2025
Merged via the queue into main with commit 9cb3905 Oct 16, 2025
7 checks passed
@OnestarLee OnestarLee deleted the feat/migrate-firebase-message-version branch October 16, 2025 01:35
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.

3 participants