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(messaging, android): add priority + originalPriority to RemoteMessage #8069

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

mikehardy
Copy link
Collaborator

@mikehardy mikehardy commented Oct 19, 2024

Description

messages may be sent as high priority but downgraded to normal priority on
delivery and it is very important for applications to know this

if a priority is downgraded from high to normal, the application may not
start foreground services and the app will crash if a foreground start is
attempted

These are android-specific types not present on web, so I followed the pattern of other non-web typescript types by making them optional / warned they could be undefined

The two properties:

https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/RemoteMessage#getPriority()
https://firebase.google.com/docs/reference/android/com/google/firebase/messaging/RemoteMessage#getOriginalPriority()

The java IntDef that drives the typescript enum definition:

https://github.com/firebase/firebase-android-sdk/blob/b6d01070d246b74f02c42da5691f99f52763e48b/firebase-messaging/src/main/java/com/google/firebase/messaging/RemoteMessage.java#L57-L64

Related issues

Related:

Release Summary

Two conventional commits that should trigger semantic release correctly if this PR is rebase-merged

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • 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
    • No

Test Plan


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

they are a derived compilation artifact, useful locally for
incremental compilation but no need to version them

see https://www.typescriptlang.org/tsconfig/#tsBuildInfoFile
…ssage

messages may be sent as high priority but downgraded to normal priority on
delivery and it is very important for applications to know this

if a priority is downgraded from high to normal, the application may not
start foreground services and the app will crash if a foreground start is
attempted

see invertase/notifee#470
Copy link

vercel bot commented Oct 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2024 0:56am

@mikehardy mikehardy added platform: android plugin: messaging FCM only - ( messaging() ) - do not use for Notifications Workflow: Needs Review Pending feedback or review from a maintainer. labels Oct 19, 2024
@mikehardy mikehardy merged commit c324932 into main Oct 21, 2024
20 checks passed
@mikehardy mikehardy deleted the @mikehardy/messaging-android-priority branch October 21, 2024 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: android plugin: messaging FCM only - ( messaging() ) - do not use for Notifications Workflow: Needs Review Pending feedback or review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant