Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: migrate to use Notifee #12668

Merged
MounirDhahri merged 27 commits intomainfrom
feat/use-notifee
Oct 6, 2025
Merged

feat: migrate to use Notifee #12668
MounirDhahri merged 27 commits intomainfrom
feat/use-notifee

Conversation

@MounirDhahri
Copy link
Member

@MounirDhahri MounirDhahri commented Aug 22, 2025

Description

This PR migrates Eigen to use notifee instead of react-native-push-notification to handle our push notifications.

Current state analysis

Our push notifications handling logic is different between iOS and Android, making it tricky to keep the same logic between both. The iOS code for example, has a lot of complexity from the days where we had plenty of native screens, that is no longer required.

Changes made

After this PR we will be consolidating many parts of our notifications infra across both platforms. This is how the logic will be now.

We will have a single hook that is shared between both platforms to manage push notifications (usePushNotifications). This hook will contain logic to listen to push notification events and handle it.

Note:

  • The listening logic is different between platforms. We use Google Cloud Messaging Services on Android but Apple Push Notification Services for iOS.

QA Doc here: https://www.notion.so/artsy/2025-09-29-Mobile-Feature-QA-Notifee-272cab0764a080b69da1cfbbcffa9616

PR Checklist

  • I have tested my changes on the following platforms:
    • Android.
    • iOS.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos at least on Android, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

  • use notifee - mounir

Need help with something? Have a look at our docs, or get in touch with us.

@MounirDhahri MounirDhahri self-assigned this Aug 22, 2025
@MounirDhahri
Copy link
Member Author

@cursor review

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@MounirDhahri MounirDhahri force-pushed the feat/use-notifee branch 3 times, most recently from 4519c2c to 91b9f62 Compare August 26, 2025 09:32
cursor[bot]

This comment was marked as outdated.

@MounirDhahri MounirDhahri force-pushed the feat/use-notifee branch 2 times, most recently from e64e827 to 39ece28 Compare August 26, 2025 12:18
@MounirDhahri MounirDhahri force-pushed the feat/use-notifee branch 5 times, most recently from 6f4c1a7 to a9b01f0 Compare September 18, 2025 12:01
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 migrates Eigen from using react-native-push-notification to notifee for handling push notifications, consolidating the push notification logic across iOS and Android platforms while maintaining the same functionality.

Key changes include:

  • Complete replacement of react-native-push-notification with notifee and Firebase Messaging
  • Consolidation of push notification handling logic between iOS and Android
  • Introduction of new unified hooks for notification management

Reviewed Changes

Copilot reviewed 49 out of 52 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/app/utils/PushNotification.ts Simplified to only handle token saving, removing notification handling logic
src/app/system/notifications/ New notification system using notifee with unified hooks for channels, FCM messages, and notification handling
src/setupJest.tsx Updated mocks to reflect new notification libraries
package.json Replaced react-native-push-notification with notifee and Firebase packages
ios/android config Updated native configurations to work with new notification system
Comments suppressed due to low confidence (1)

src/app/system/notifications/tests/useHandlePushNotifications.tests.ts:1

  • Using // @ts-ignore suppresses TypeScript errors but should be avoided. If this component isn't used in the test file, consider removing it or properly typing it.
import notifee, { Event, EventType, Notification } from "@notifee/react-native"

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

token = (await LegacyNativeModules.ArtsyNativeModule.getPushToken()) ?? ""
}

if (!token) {
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

The function checks for falsy token but doesn't handle the case where token is an empty string explicitly. Consider using if (!token || token.trim() === '') to handle empty string tokens properly.

Suggested change
if (!token) {
if (!token || token.trim() === '') {

Copilot uses AI. Check for mistakes.
Comment on lines 12 to 13
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

Using // @ts-ignore suppresses TypeScript errors and should be avoided. Consider properly typing the component or removing the annotation if it's not necessary.

Suggested change
// @ts-ignore
const Content: React.FC = () => {
const Content = () => {

Copilot uses AI. Check for mistakes.
@MounirDhahri MounirDhahri force-pushed the feat/use-notifee branch 3 times, most recently from c36f5d2 to 73f7fc4 Compare September 26, 2025 09:25
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@araujobarret araujobarret left a comment

Choose a reason for hiding this comment

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

I think we need to tweak Expo related config https://rnfirebase.io/messaging/usage#expo

@MounirDhahri MounirDhahri merged commit e4ad917 into main Oct 6, 2025
8 checks passed
@MounirDhahri MounirDhahri deleted the feat/use-notifee branch October 6, 2025 13:03
@MounirDhahri
Copy link
Member Author

🚀 🚀 🚀 🚀 🚀

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.

4 participants

Comments