Coder Social home page Coder Social logo

kimtrien / simple-push-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gauntface/simple-push-demo

0.0 2.0 0.0 129.23 MB

A simple example of use push notifications on the web using Service Workers

JavaScript 81.75% HTML 15.74% CSS 2.51%

simple-push-demo's Introduction

Simple Service Worker Push Demo

The goal of this repo is to demonstrate how to implement push notifications into your web app.

Requirements

Using the Demo

To try out the demo locally, clone the repo and run the following:

  1. Install the required NPM modules for building the project

     npm install
    
  2. Install gulp globally

     npm install gulp -g
    
  3. Run the gulp server

     gulp serve
    

This will open up your browser on the relevant page, now if you open http://localhost:3000 in Chrome canary you should be able to enable push notifications.

Imgur

The two methods you can send a push message to your device after enabling it are:

  1. Send a push to GCM via XHR

    • This button sends a request to an App Engine app which then sends a request to GCM (Google Cloud Messaging), emulating what would happen when a server wants to send a push message to a user.
  2. Send a push to GCM using CURL

    • This option is nice and easy, copy and paste the CURL command into a terminal and it will make a request to GCM (Google Cloud Messaging) which will then send the push message. Useful to see what a request to GCM consists of.

simple-push-demo's People

Contributors

adrifelt avatar beverloo avatar mounirlamouri avatar slightlyoff avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.