Class Notifications
java.lang.Object
com.example.slacks_lottoevent.Utility.Notifications
Handles notification-related operations, including adding notifications
to the Firestore database and removing notifications associated with specific users.
This class interacts with the following Firestore collections: - "events" for retrieving lists of device IDs associated with an event. - "profiles" for fetching user profile details based on device IDs. - "notifications" for storing and managing user-specific notifications.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotifications
(String customName, String customMessage, String listToGrab, String eventId) Adds notifications to the "notifications" Firestore collection for all users listed in a specific group (e.g., waitlist) of an event.void
removeNotifications
(String deviceId) Removes all notifications associated with a specific user ID from the "notifications" Firestore collection.
-
Field Details
-
deviceIds
-
-
Constructor Details
-
Notifications
public Notifications()Constructs a new instance ofNotifications
. Initializes a Firestore database instance for performing database operations.
-
-
Method Details
-
addNotifications
public void addNotifications(String customName, String customMessage, String listToGrab, String eventId) Adds notifications to the "notifications" Firestore collection for all users listed in a specific group (e.g., waitlist) of an event.- Parameters:
customName
- The title of the notification.customMessage
- The message content of the notification.listToGrab
- The key in the event document representing the list of device IDs.eventId
- The unique identifier of the event to retrieve the list from.
-
removeNotifications
Removes all notifications associated with a specific user ID from the "notifications" Firestore collection.- Parameters:
deviceId
- The unique identifier of the user or device whose notifications should be deleted.
-