Class NotificationHelper
java.lang.Object
com.example.slacks_lottoevent.Utility.NotificationHelper
Helper class for managing and sending notifications in the application.
This class handles notification permissions, building notification content,
and displaying notifications to the user.
-
Constructor Summary
ConstructorsConstructorDescriptionNotificationHelper
(android.app.Activity activity) Constructs a new instance ofNotificationHelper
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
sendNotifications
(String deviceId, String title, String message) Sends a notification with the specified title and message to the user.
-
Constructor Details
-
NotificationHelper
public NotificationHelper(android.app.Activity activity) Constructs a new instance ofNotificationHelper
.- Parameters:
activity
- The activity context used for permission checks and notification management.
-
-
Method Details
-
sendNotifications
Sends a notification with the specified title and message to the user. Handles permission requests- Parameters:
deviceId
- A unique identifier for the device, used to generate unique notification IDs.title
- The title of the notification.message
- The message content of the notification.
-