pusher / push-notifications-web

Beams Browser notifications
MIT License
39 stars 19 forks source link

Is supported method #90

Closed leesio closed 3 years ago

leesio commented 3 years ago

Only throw errors for configuration errors, not compatibility errors. If there is an incompatiblity error (either the browser does not support web push or something, or safari credentials don't exist for the instance) return false from isSupportedBrowser() and expose details in client.error

beamsClient.isSupportedBrowser().then((result) => {
  if (!result) {
    console.log(`Beams not supported: ${beamsClient.error}`);
    return
  }
  renderPushNotificationsButton(beamsClient);
});