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

Fix double notification on Android #2156

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Fix double notification on Android #2156

merged 2 commits into from
Dec 18, 2024

Conversation

neven-s
Copy link
Collaborator

@neven-s neven-s commented Dec 13, 2024

Description

Ticket: CP-9567

This fixes double notification on Android devices when app is in background since FirebaseSDK automatically handles FCM with notification payload.

Testing

  • make sure that notifications are enabled in system and app settings
  • make sure you are receiving any notifications and hear sound
  • use wallet on another device to send some funds on testing device (can be same wallet)
  • observe that no double sound is heard or double notifications present

Checklist

Please check all that apply (if applicable)

  • I have performed a self-review of my code
  • I have verified the code works
  • I have added/updated necessary unit tests
  • I have updated the documentation

@neven-s neven-s marked this pull request as ready for review December 16, 2024 12:16
@@ -321,16 +321,14 @@ class NotificationsService {
pressAction: {
id: PressActionId.OPEN_PORTFOLIO,
launchActivity: LAUNCH_ACTIVITY
}
},
channelId: channelId ?? ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a difference between passing an empty string and undefined for channelId?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, in my experience notifee will report such payload as invalid

Copy link
Contributor

Choose a reason for hiding this comment

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

it's weird since channelId is an optional parameter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's optional for ios platform, on android it's required

@neven-s neven-s merged commit 70f9b30 into main Dec 18, 2024
4 checks passed
@neven-s neven-s deleted the CP-9567 branch December 18, 2024 20:57
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.

2 participants