I was told to schedule tasks in the cloud to do tasks to my Realtime Database in Firebase I need to use the Server SDK.
Let's say I'm saving data to the Firebase database using this code:
DatabaseReference usersRef = ref.child("users");
Map<String, User> users = new HashMap<String, User>();
users.put("alanisawesome", new User("June 23, 1912", "Alan Turing"));
users.put("gracehop", new User("December 9, 1906", "Grace Hopper"));
usersRef.setValue(users);
But I want to upload this as a task for tomorrow. What I mean is, this will save TOMORROW instead of the instant this code gets run.
I have a Calendar
ready:
Calendar cal = Calendar.getInstance();
cal.add(DAY_OF_MONTH,1); //This could be wrong, but I'm just telling you I have a Calendar ready, so ignore any errors in this code
So, how can I save a task using the Firebase Server SDK? The docs don't provide a clear answer for this since the only thing I can see is saving data just like the Realtime Database.