I converted a webpage to a mobile app using Dotnet MAUI. I’m trying to implement push notification on the webpage which is now an app but not sure how to go about it. I saw a post on using the Push API in conjunction with a service worker to get notifications from a server but it wasn’t real clear and I’m not sure if what I’m attempting to do is even possible. The online post I saw showed how to listen for a notification sent to a website using Javascript.
Since I don’t have a website but an app I can’t send a notification to a specified URL from the server. Thus, I would like to know if I can listen for a notification sent from a server to a specific mobile number using service worker and javascript on my webpage (which has been converted into an app). So basically the following is what I want to do:
First I setup the Push API on the server to send a notification to various devices (phone, tablets, etc.) that has my app installed.
Second get the notification that was sent to mobile numbers using Javascript.
Please comment whether this is possible and if not what is an alternative.