Package com.example.rocket_launch
Class NotificationHelper
java.lang.Object
com.example.rocket_launch.NotificationHelper
contains helpful functions for sending and creating notifications
Author: Griffin
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNotificationToDatabase(String androidId, String title, String message) Updates the user's notification list in the database.static voidcreateNotificationChannel(android.content.Context context) Creates a notification channel for devices running API 26+.static voidsendNotification(String androidId, String title, String message) sends a notification to the given user with title and message Authors: Griffin, Kaidenstatic voidsendPrefabNotification(String androidId, Notification notification) sends a pre-made notificatoin to users Authors: Griffin, Kaidenstatic voidshowNotification(android.content.Context context, String title, String message, int notificationID) Displays a notification using the NotificationCompat library.
-
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
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
sends a notification to the given user with title and message Authors: Griffin, Kaiden- Parameters:
androidId- id of user to send totitle- title of the notificationmessage- message for the notification
-
sendPrefabNotification
sends a pre-made notificatoin to users Authors: Griffin, Kaiden- Parameters:
androidId- android ID of user to send tonotification- notification to send to user
-