0

We are developing an app for Android and IOS for students. student can receive notification for upcoming events like exams or interviews. We are between two decisions: Using FCM with the development of a backed which manages the sending of notifications and the registration of tokens or using the schedulers that exist in IOS and Android then download a list of events from an API regularly and trigger a local notification which will require less development on the backend side but a little more on the frontend side. What would be best in your opinion and can we trigger a notification even if the app is closed for the 2nd solution?

Zakaria
  • 11
  • 2

1 Answers1

0

I would deffinitely recommend to use FCM. It is much easier than it looks like and the performance of your notifications would be much better regarding stability, timing, battery persistance and other. You can use on of the Firebase databases to store the notification tokens and the Firebase Cloud Functions to send them from there. I have made a very similar App for Kindergarden children and it works great. I'm not sure if it would even work at all when you do it on your own. At least not as you expect it. For me that sounds like much more work.

Tarik Huber
  • 7,061
  • 2
  • 12
  • 18
  • Thank you for your answer. We have 10000 students, the backend will have to store tokens, deal with orphans tokens, look every time if there are exams, interviews and send them to each student, so each student can receive custom notification. I agree with you that with FCM it's more "Standard", I think that with an endpoint, the app will download data of the next events 1 time per day only, and schedule it one time on the android/ios. This is the main idea. I don't know if it's doable like I imagine it. Do you have an example of backend that manages tokens? Thank you again – Zakaria May 22 '21 at 13:48
  • For the database I would recommend `Firestore` from Firebase and to use Firebase Cloud Functions to send the notifications. You can very easy do that using the firebas admin sdk on the cloud functions. There are multiple ways to shedule a notification on device. I deffinitely understand the use case. There are multiple sources that takle the problem: https://firebaseopensource.com/projects/patilshreyas/fcm-ondevicenotificationscheduler/ and https://stackoverflow.com/a/60714000/5519300 Let me know how you will continue and if you have more questions. – Tarik Huber May 22 '21 at 18:46