Giter VIP home page Giter VIP logo

pushjslibrary's Introduction

pushJSlibrary

notification server PUSH client implemented in JS to be used as a fallback for navigator.mozPush or navigator.push on all browsers

Author:

  • Fernando Rodríguez Sela (frsela @ tid . es)

How to use

Import this JS library. From the app register the URL:

navigator.push.requestURL(WAToken, PublicKey (in Base64));

To change the default configuration use the setup method:

navigator.push.setup({
   "host": "PUSH_SERVER_HOSTNAME",
   "port": PUSH_SERVER_PORT,
   "ssl" : [ true | false ],

   ---> FOLLOWING attributes are only used in this fallback library <---

   "debug": [ true | false ],
   "keepalive": WEBSOCKET_KEEPALIVE_TIMER (in msecs),

   ---> FOLLOWING attributes are only used for testing purpose in order
        to simulate UDP/TCP wakeup service in the client machine.
        use only if you know what are you doing <---
   "wakeup_enabled": [ true | false ],
   "wakeup_host": "WAKEUP_HOSTNAME",
   "wakeup_port": WAKEUP_PORT,
   "wakeup_protocol": [ 'tcp' | 'udp' ],
   "wakeup_mcc": 'MOBILE COUNTRY CODE',
   "wakeup_mnc": 'MOBILE NETWORK CODE'
});

Each JSON attribute is optional, so you can configure one, two or all in a single request.

Call setup before any other use

To reset to factory defaults:

To recover current setup:

navigator.push.getSetup()
navigator.push.defaultconfig();

CDN

The last release of the JS library is available in: http://frsela.github.com/pushJSlibrary/

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.