I am confused between option to send a notification to mobile. I have a backend created in .Net core deployed on Azure. Now push notification must be sent to mobile devices when admin launches new offer. I fount 3 good alternatives to it. All are calling Firebase FCM and APNS in their in their own way.
- Azure Notification hub : what I understood here is that I would not require to save device id, uris in my db. Notification hub will take care of it. We can call it directly in services in .net core code. Moreover it offers localized message sending and deactivating fcm, apns tokens of non active devices by itself.
However it is paid. - Azure function trigger : I have seen people employee technique, where people create Azure queues for FCM and APNS, Then in the services (DB context services), the groups of ids are created on the basis of type of device. Then all android notification payloads are pushed to fcm queue and apns payloads are pushed to apns queue. After that a queue triggered functions configured for both fcm/apns are invoked which in turn interact with firebase and apns services and send notification to devices.
This is reliable and but coding would be more. Would need to save device token by myself when user signup on app. - Calling FCM and APNS services directly in the .net core services. There are lot of tutorials for this available. Is the cheapest solution. However, I don’t know how reliable is this. like this example here
2
Answers
Go for Notification Hub. It’ll reduce burden from your head regarding manual efforts.
We’re using azure notification hubs, there is a low cost tier that is more than adequate for many projects and worth the money imo for the time it saves.
We have a service bus that triggers some very light weight functions. Azure hubs have a tag concept, so on app launch the hub is initialised and we set a tag for the logged in user ID which the backend can use to send messages via the hub/PNS