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

Feature Request: Push Notification for New Messages using FCM #169

Closed
Alpha17-2 opened this issue Jun 13, 2024 · 0 comments · Fixed by #173
Closed

Feature Request: Push Notification for New Messages using FCM #169

Alpha17-2 opened this issue Jun 13, 2024 · 0 comments · Fixed by #173
Assignees
Labels
Feature required New feature or request

Comments

@Alpha17-2
Copy link
Collaborator

Description

Implement a feature that sends a push notification to a user when they receive a new message from another user. This will use Firebase Cloud Messaging (FCM) to deliver the notifications. The notification should include the sender's name and a preview of the message content.

Requirements

  1. FCM Integration:

    • Integrate Firebase Cloud Messaging (FCM) to send push notifications.
    • Ensure FCM tokens are stored and managed for each user.
  2. Trigger Notification:

    • Trigger a notification when a new message is sent.
    • Fetch the recipient's FCM token from the database.
  3. Notification Content:

    • The notification should include the sender's name.
    • A preview of the message content should be displayed.
  4. Handle Notification:

    • Ensure the app can handle incoming notifications.
    • Clicking on the notification should navigate the user to the relevant chat screen.

Implementation Details

  1. Store FCM Tokens:

    • Update the user profile creation and login flows to capture and store the FCM token for each user.
  2. Send Notification on New Message:

    • Modify the message sending logic to include a step that sends a notification to the recipient.
    • Use the stored FCM token to send the notification via Firebase Cloud Messaging.
  3. Notification Payload:

    • Create a payload structure that includes the sender's name and a message preview.
  4. App Notification Handling:

    • Update the app to handle incoming notifications.
    • Ensure the app navigates to the correct chat screen when a notification is clicked.

Steps to Reproduce

  1. User A sends a message to User B.
  2. User B should receive a push notification on their device with the message content and sender's name.
  3. Clicking on the notification should open the app and navigate to the chat screen with User A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature required New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant