Class NotificationHelper

java.lang.Object
com.example.rocket_launch.NotificationHelper

public class NotificationHelper extends Object
contains helpful functions for sending and creating notifications Author: Griffin
  • Constructor Details

    • NotificationHelper

      public NotificationHelper()
  • Method Details

    • createNotificationChannel

      public static void createNotificationChannel(android.content.Context context)
      Creates a notification channel for devices running API 26+. Call this during app initialization or before showing notifications. Author: griffin
    • showNotification

      public static void showNotification(android.content.Context context, String title, String message, int notificationID)
      Displays a notification using the NotificationCompat library. Author: Griffin
      Parameters:
      context - The application context.
      title - The notification title.
      message - The notification message.
      notificationID - Unique ID for the notification.
    • addNotificationToDatabase

      public static void addNotificationToDatabase(String androidId, String title, String message)
      Updates the user's notification list in the database. Author: Griffin
      Parameters:
      androidId - The user's unique device ID.
      title - The notification title.
      message - The notification message.
    • sendNotification

      public static void sendNotification(String androidId, String title, String message)
      sends a notification to the given user with title and message Authors: Griffin, Kaiden
      Parameters:
      androidId - id of user to send to
      title - title of the notification
      message - message for the notification
    • sendPrefabNotification

      public static void sendPrefabNotification(String androidId, Notification notification)
      sends a pre-made notificatoin to users Authors: Griffin, Kaiden
      Parameters:
      androidId - android ID of user to send to
      notification - notification to send to user