Skip to content

Pushwoosh/web-push-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pushwoosh Web Push Notification SDK

GitHub release npm platforms

Download Guide Sample NPM Package

Integration

  • Download Pushwoosh Web Push SDK and unzip it. You should have the following files: pushwoosh-service-worker.js

  • Place all these files to top-level root of your website directory.

Installation

via html

<script type="text/javascript" src="//cdn.pushwoosh.com/webpush/v3/pushwoosh-web-notifications.js" async></script>
<script type="text/javascript">
  var Pushwoosh = Pushwoosh || [];
  Pushwoosh.push(['init', {
    apiToken: 'XXXXXXX', //  Device API Token
    applicationCode: 'XXXXX-XXXXX', // you application code from Pushwoosh Control Panel
    safariWebsitePushID: 'web.com.example.domain', //  unique reverse-domain string, obtained in you Apple Developer Portal. Only needed if you send push notifications to Safari browser
    defaultNotificationTitle: 'Pushwoosh', // sets a default title for push notifications
    defaultNotificationImage: 'https://yoursite.com/img/logo-medium.png', // URL to custom custom notification image
    autoSubscribe: true, // or false. If true, prompts a user to subscribe for pushes upon SDK initialization
    subscribeWidget: {
      enable: true
    },
    userId: 'user_id', // optional, set custom user ID
  }]);
</script>
Chrome Guide Firefox Guide Safari Guide HTTP integration Guide Subscription Button Guide

About

Web Push Notifications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 7