php - How to prompt notification on user time set in flutter

I am trying to work around it where the user can set a time and an alarm or notification will prompt when it is exactly the time set in my flutter app. I am using PHP for my backend and also FCM for my notification. Am open to any idea to achieve this.
Answer
Solution:
You can subtract the timestamp at which user wants the alarm and the current timestamp. After that you can schedule the cloud function to trigger notification at that time like for every 5 minutes:-
exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) => {
console.log('This will be run every 5 minutes!');
return null;
});
or you can put the time at which he wants like on 5th august 13:45 :-
exports.scheduledFunction = functions.pubsub.schedule('45 13 5 8 *').onRun((context) => {
console.log('This will run on 5th August at 13:45!');
return null;
});
To understand the second pls refer schedules
Now in the function add the push notification code.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: malformed utf-8 characters, possibly incorrectly encoded
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.