How To Receive Notifications While My App Isn't Running?
Solution 1:
You will have to use Firebase Cloud Messaging, But i think in your case it won't be that simple. As your app is mirroring your website, so website will be having a database, which i think won't be Firebase Db. So you will have to somehow hook the database event, when an employee marks vacation, then you have to call cloud functions.
Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests.
You will have to call this url, whenever you write in your database, and then from cloud functions you will have to trigger FCM.
Solution 2:
Actually, Notification requires the device token and using Firebase Cloud Messaging
But in your case, Some employee is using the website to apply so you aren't able to get the device token of that devices so as per my concern this is not possible to send notification in this case. But if Employee will use the Android mobile application to apply then you can use Firebase Cloud Messaging to send the notification.
Hope, this will help you to clear about notification. Happy coding...
Solution 3:
Integrate Firebase to your app and generate FCM Token.Save them every time the user logins. Now you can send the notification to particular users using this token. check this link to set up Firebase and generate FCM Token:
https://firebase.google.com/docs/cloud-messaging/android/client
Solution 4:
Here is my thought, You mention that your manager uses the mobile to get the notification of the employee vacation request. so either you get your manager phone token using firebase or you have to get token of the code using your own code and store that token in your web database. After that when employee request for the vacation from mobile or from the website then there is push generation option in the firebase so you have to integrate that code in both sides website as well as in the mobile application also.
so i think this is the solution that i thought.below is the link for push fire from web.
https://developers.google.com/web/fundamentals/codelabs/push-notifications/
Here is the documentation for the android application integration: https://firebase.google.com/docs/cloud-messaging/android/client
Post a Comment for "How To Receive Notifications While My App Isn't Running?"