androidfirebasekotlingoogle-cloud-firestorefirebase-notifications

How to notify a store owner when the estimated delivery time is over in an e-commerce app using firebase


I need some ideas on how I can approach for a feature in a firebase based multi vendor e-commerce app. I want to send a notification to the store owner when the estimated delivery time is over.

When users place a order from a store, an estimated time like 50 minutes will be added to the order info. Now I have to schedule a notification for the owner if it's over 50 minutes and the order status is still pending, the owner will get a notification.

I don't have any code to attach because I am still thinking the approach. My idea is that every store owner will be subscribed to a topic as the storeId or I can send notification using the token of the owner. So only store owner will receive the notification.

But should I schedule the time using a cloud function for every orders or there are other ways to accomplish this?


Solution

  • But should I schedule the time using a cloud function for every orders or there are other ways to accomplish this?

    The notification sending should be triggered by a back-end and Cloud Functions is clearly the most convenient one. You could set up your own server to do so but using a serverless platform like Cloud Functions is much easier.

    There are two possible options: