Skip to content

Instantly share code, notes, and snippets.

@jpatel531
Last active August 29, 2015 14:23
Show Gist options
  • Save jpatel531/55d9745368aac487d3d1 to your computer and use it in GitHub Desktop.
Save jpatel531/55d9745368aac487d3d1 to your computer and use it in GitHub Desktop.
Pusher + Chrome Notifications
<head>
<title>Pusher Test</title>
<script src="//js.pusher.com/2.2/pusher.min.js"></script>
<script>
Notification.requestPermission();
var pusher = new Pusher('YOUR_APP_KEY');
var channel = pusher.subscribe('notifications_channel');
channel.bind('new_notification', function(data) {
var notification = new Notification('Notification title', {
body: data.message
});
});
</script>
</head>
<body>
<h1>Hello World</h1>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment