In my React App, I want to implement push notification.
What I've done so far. In the service worker registration step, I added some codes to initialize push manager that handles user subscription, now my app will prompt user to subscribe to push notification.
After subscription, from what I read, the final step is to register event listeners that catches pushes and listen to push notification click. Something like : self.addEventListener('push', function() { // Some codes here })
Now, where should I put the listener codes ? As CRA auto-generated the service-worker for production build