Php push notifications

5,704
-1

Published on

How to implement a push notification based system using: PHP/MySQL, Elephant.io, Node.js, and MQTT.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,704
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
43
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Php push notifications

  1. 1. PHP Push Notification System Mohammed S Shurrab CTO, Datrios.com CTO, UnitOne.ps
  2. 2. Pull vs Push! Pull Push
  3. 3. Architecture
  4. 4. Requirements  Back-end  Mosquitto server (http://mosquitto.org/)  Node.js (http://nodejs.org/)  Socket.io module (npm install socket.io)  Zeparser module (npm install zeparser)  MQTTClient (https://github.com/yilun/node_mqtt_client)  Front-end  Sockit.IO (http://cdnjs.com/libraries/socket.io/)  jQuery (http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js)
  5. 5. Client code 1. Connect to the node.js server through soket.io (L:5) 2. Subscribe to some topic(s) (L:10) 3. Listen to any notification for these topics (L:7-9)
  6. 6. Node.js code (1/3) 1. include the required modules (L:1-5) 2. Specify the web socket port (L:5) 3. Connect to the MQTT server (L:6)
  7. 7. Node.js code (2/3) 1. Listening to a successful socket connection (L:8) 1. Listening to a subscribing request from the client (L:9-13) 1. Filtering the web socket data based on the topics (L:11) 2. Listening to a notify request from the server (L:15-18)
  8. 8. Node.js code (3/3) 1. Listening to a new notification from the MQQT server (L:21) 1. Sent these notification through the web socket (L:23-25) 2. Listening to a successful connection with the MQTT server and sent a test notification every 5 seconds (L:29-33)
  9. 9. DEMO
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×