I am creating an app to book parking in different locations in that when Admin accepts a user parking request I have set that particular Location's slot status as true. But I want to reset that Status as false After the user's departure time has passed. For that, I am setting an alarm but I am facing some issues.
This is my transfferData() This is my scheduleDepartureAlarm()This is my getMillisFromStringDateTime() This is my DepartureAlarmReceiver class This is my FirebaseHelper class
I want to reset my slot status as false after Departure time is passed for that i am setting an alarm But it was facing some issue I declared all permissions in menifest file but facing issue to reset Status Any guidance you can provide would be invaluable.
Firestore itself doesn't directly support scheduling updates for documents after a specific delay. If you need to change the value of a particular field that exists inside a Firestore document, after some time has passed then I recommend you use Cloud Functions for Firebase along with Cloud Tasks. So you have to perform a two-step operation:
Create a Cloud Function that updates the desired field in your Firestore document.
When a document is created in Firestore, trigger a Cloud Task that calls your Cloud Function. This Cloud Task should be scheduled to run in one hour, for example.
This solution will work without any user interaction. So adding an alarm in the client-side code doesn't sound like the best solution.