Skip to content

Feature/notifications#77

Merged
Roshan1299 merged 39 commits intomainfrom
feature/notifications
Dec 25, 2025
Merged

Feature/notifications#77
Roshan1299 merged 39 commits intomainfrom
feature/notifications

Conversation

@Roshan1299
Copy link
Copy Markdown
Owner

🚀 Feature: Push Notification System for Enhanced User Engagement

🔍 Overview
This PR introduces a comprehensive push notification system using Firebase Cloud Messaging (FCM) that alerts
users in real-time when they receive new messages. The system automatically sends push notifications when a user
receives a message from another user, significantly improving the responsiveness and engagement of the messaging
feature.

✨ What's New

📱 Android Frontend

  • FCM Service Implementation: Added FCMService to handle token registration and push notification reception
  • Token Management: Automatic FCM token registration with the backend when users log in or when tokens refresh
  • Notification Handling: Implemented system-level push notifications for incoming messages with proper channels
    and formatting
  • Navigation Fixes: Corrected navigation flow from collaborate fragment to profile fragment
  • Dependency Management: Properly configured Firebase dependencies and Google Services plugin

⚙️ Backend

  • FCM Token Storage: Added FCM token field to User entity for storing device tokens
  • Notification Service: Implemented service to send push notifications via Firebase Admin SDK
  • API Endpoints: Created endpoints for registering and unregistering FCM tokens
  • Message Integration: Enhanced message sending flow to automatically trigger push notifications
  • Firebase Configuration: Added Firebase Admin SDK integration with service account configuration

📋 Changes Summary

Android Components

  • FCMService.kt: Complete Firebase Messaging Service implementation
  • NotificationDtos.kt: Added DTOs for notification management
  • notifications/ package: New package for FCM-related functionality
  • DevSwipeApplication.kt: Updated to initialize Firebase
  • NetworkModule.kt: Added TokenProvider and notification service configuration
  • AuthManager.kt: Enhanced with FCM token registration methods
  • AndroidManifest.xml: Added FCM service declaration
  • nav_graph.xml: Fixed navigation action from collaborate to profile

Backend Components

  • User.kt: Added FCM token field to user entity
  • UserRepository.kt: Added method to find user by FCM token
  • NotificationService.kt: Complete service for sending FCM notifications
  • NotificationController.kt: API endpoints for FCM token management
  • FirebaseConfig.kt: Firebase Admin SDK configuration
  • ChatService.kt: Enhanced to trigger notifications when sending messages
  • ChatController.kt: Updated for notification integration
  • NotificationDtos.kt: Data transfer objects for notification functionality
  • build.gradle.kts: Added Firebase Admin SDK dependency

Configuration Files

  • google-services.json: Added for Android Firebase integration
  • firebase-service-account.json: Service account key for backend FCM service

🧪 Testing Notes

  • Push notifications are automatically sent when a user receives a message
  • FCM tokens are registered with the backend upon user login
  • Notifications appear in the system status bar when app is in background
  • App properly handles token refreshes and re-registers with backend
  • Navigation issues between collaborate and profile fragments are resolved

🎯 User Journey

  1. User logs in and FCM token is automatically registered with the backend
  2. Another user sends a message through the chat interface
  3. Backend detects the message and sends a push notification to the recipient's device
  4. Recipient receives the push notification in their status bar
  5. Tapping the notification opens the app to the conversation

🔁 Related Features

  • Leverages existing chat functionality to trigger notifications
  • Works in conjunction with profile navigation and user messaging system
  • Integrates with the existing JWT authentication system
  • Utilizes the established MVVM architecture and Hilt dependency injection

🏗️ Architecture

  • Frontend: FCM service follows Android messaging best practices
  • Backend: Notification service follows clean architecture principles
  • Security: Tokens are only registered with valid JWT authentication
  • Scalability: Designed to handle multiple users and concurrent notifications
  • Integration: Seamlessly works with existing messaging infrastructure

🚀 Ready for Review
This comprehensive notification system significantly enhances user engagement by providing real-time alerts for
new messages, making the DevSwipe messaging experience more responsive and interactive. The implementation
follows best practices for both Android and Spring Boot applications while maintaining complete compatibility
with existing functionality.

@Roshan1299 Roshan1299 merged commit 6382279 into main Dec 25, 2025
1 of 2 checks passed
@Roshan1299 Roshan1299 linked an issue Jan 13, 2026 that may be closed by this pull request
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.

US 08.03.01

1 participant