Skip to content Skip to sidebar Skip to footer

Push Notifications In Progressive Web App Through Gcm

while sending push notification i got ( Uncaught (in promise) ReferenceError: require is not defined(…)) error.here is my code const endPoint = subscription.endpoint.slice(subsc

Solution 1:

This code uses require, so it looks to me like you're trying to use node code in the browser. To do that you'll need to use something like Browserify, although I'm not sure that's going to work for node-gcm as it may have certain requirements about sending network requests without cross origin restrictions etc.


Post a Comment for "Push Notifications In Progressive Web App Through Gcm"