Reputation: 95
Is it possible to send a PWA installed on an Android phone push notifications with CRA?
Constraints:
Upvotes: 0
Views: 4110
Reputation: 21
You can send notifications to your service worker using push notification API . You can send notifications to a react app using the service worker mechanism. You can get a service worker pre-configured by generating the code with Create React App. More details about CRA service-worker here.
`npx create-react-app my-app --template cra-template-pwa`.
In order to add push notifications you will need to implement a listener inside your business logic that will trigger the notification (a processing result, a button push... etc) then you can trigger the notification as mentioned here.
check the documentation : https://developers.google.com/web/ilt/pwa/introduction-to-push-notifications
Upvotes: 2