Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update FCM and Notification Services to better support push impl #13441

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Feb 11, 2025

Description

This is another partial PR from our large draft feature branch: #13006

We have 1 (or 2) more PRs to do the integration and then push notifications are in!

Related issues

Fixes:

Manual testing steps

No testing steps yet, this PR is not (yet) testable as the feature is not released and incomplete.

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

clean up the interface, and add comments and methods for parts we actually want to expose
add better tests, and correctly handle notification data payload strings
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Comment on lines 31 to 33
/**
* @todo - update controller to get up-to-date state
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO - we need to publish the new controller changes. But this is not breaking if we do merge this in.


/**
* Registers Push Notifications
* @todo - clean up props once we finalise integration
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reduce codeowners, we've kept the same interface.
We'll create a separate PR to remove these unused props.

Comment on lines +149 to +154
// We only subscribe to foreground messages, as subscribing to background messages that contain `notification` + `data` payloads have issues
// IOS - requires payload editing (https://notifee.app/react-native/docs/ios/remote-notification-support)
// IOS - requires isHeadless injection and app modification to ship a minimal app when headless (https://rnfirebase.io/messaging/usage#background-application-state).
// Android - will cause double notifications if a remote message contains both `notification` + `data` payloads
// Firebase will still send push notifications in background + app kill as there is a `notification` payload in the remote message
await this.#registerForegroundMessages(handler);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... there is a lot of edge cases with push notifications across platforms.
Keeping this lengthy comment for future devs/me.

@@ -30,23 +29,29 @@ class NotificationsService {
async getBlockedNotifications(): Promise<Map<ChannelId, boolean>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TBH most of this was designed before and I don't have much context around it.
There may be some stuff here that is not needed. But we'll keep this for now.

@Prithpal-Sooriya Prithpal-Sooriya added the Run Smoke E2E Triggers smoke e2e on Bitrise label Feb 11, 2025
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review February 11, 2025 19:40
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner February 11, 2025 19:40
Copy link
Contributor

github-actions bot commented Feb 11, 2025

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 67d1390
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/474c31a2-9011-47c0-a3c1-95bbe167581b

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

quality gate spotted some good finds, and also not useful comments. This should resolve the issues
@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 13, 2025
Copy link
Contributor

github-actions bot commented Feb 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e5daa24
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2be8d41d-e998-43e8-86f7-6e8aca16bd59

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 13, 2025
@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 13, 2025
Copy link
Contributor

github-actions bot commented Feb 13, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 00e9486
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1ee03240-1548-4678-904a-c357e508a063

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@Prithpal-Sooriya Prithpal-Sooriya added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Feb 13, 2025
Copy link
Contributor

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 79fdfa5
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d62d86b6-7f26-4691-a509-6d297b3beb7c

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants