SlideShare une entreprise Scribd logo
1  sur  10
PHP
Push Notification System
Mohammed S Shurrab
CTO, Datrios.com
CTO, UnitOne.ps
Pull vs Push!

Pull

Push
Architecture
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)
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)
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)
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)
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)
DEMO
Php push notifications

Contenu connexe

Tendances

Tanque Septicos
Tanque SepticosTanque Septicos
Tanque Septicosmaryvi3008
 
Sanitary fixtures - BMC
Sanitary fixtures - BMCSanitary fixtures - BMC
Sanitary fixtures - BMCHepilvekariya
 
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.com
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.comDecorative Wall Texture, plaster & external flooring. www.balajiwalltexture.com
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.comNarendra Joshi
 
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...Silen Alejandro Hernández Yoc
 
Instrucciones instalaciones sanitarias
Instrucciones  instalaciones sanitariasInstrucciones  instalaciones sanitarias
Instrucciones instalaciones sanitariasJose Sirica
 
Plumbing and sanitation
Plumbing and sanitationPlumbing and sanitation
Plumbing and sanitationPrachi Gupta
 
Water closets and urinals
Water closets and urinalsWater closets and urinals
Water closets and urinalsAkshay Patil
 
How steel helps in the construction of steel door and window frames?
How steel helps in the construction of steel door and window frames?How steel helps in the construction of steel door and window frames?
How steel helps in the construction of steel door and window frames?APLAPOLLO3
 

Tendances (16)

Design statement
Design statementDesign statement
Design statement
 
Tanque Septicos
Tanque SepticosTanque Septicos
Tanque Septicos
 
Sanitary fixtures - BMC
Sanitary fixtures - BMCSanitary fixtures - BMC
Sanitary fixtures - BMC
 
Cisternas
CisternasCisternas
Cisternas
 
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.com
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.comDecorative Wall Texture, plaster & external flooring. www.balajiwalltexture.com
Decorative Wall Texture, plaster & external flooring. www.balajiwalltexture.com
 
G
GG
G
 
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...
Guia general para el calculo, instalacion y mantenimiento de bombas hidroneum...
 
Instalaciones sanitarias - UGC
Instalaciones sanitarias - UGCInstalaciones sanitarias - UGC
Instalaciones sanitarias - UGC
 
Instrucciones instalaciones sanitarias
Instrucciones  instalaciones sanitariasInstrucciones  instalaciones sanitarias
Instrucciones instalaciones sanitarias
 
Plumbing and sanitation
Plumbing and sanitationPlumbing and sanitation
Plumbing and sanitation
 
Water proofing in buildings
Water proofing in buildingsWater proofing in buildings
Water proofing in buildings
 
False ceiling
False ceilingFalse ceiling
False ceiling
 
Water closets and urinals
Water closets and urinalsWater closets and urinals
Water closets and urinals
 
How steel helps in the construction of steel door and window frames?
How steel helps in the construction of steel door and window frames?How steel helps in the construction of steel door and window frames?
How steel helps in the construction of steel door and window frames?
 
Enamel paint
Enamel paintEnamel paint
Enamel paint
 
Red utfsm
Red utfsmRed utfsm
Red utfsm
 

En vedette

Push notifications
Push notificationsPush notifications
Push notificationsDale Lane
 
E content mohammed shurrab
E content   mohammed shurrabE content   mohammed shurrab
E content mohammed shurrabMohammed Shurrab
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSocketsRoland M
 
OWD - Push Notification Server Architecture [DEVCON1_2012]
OWD - Push Notification Server Architecture [DEVCON1_2012]OWD - Push Notification Server Architecture [DEVCON1_2012]
OWD - Push Notification Server Architecture [DEVCON1_2012]Fernando Sela
 
REST is not enough: Using Push Notifications to better support your mobile cl...
REST is not enough: Using Push Notifications to better support your mobile cl...REST is not enough: Using Push Notifications to better support your mobile cl...
REST is not enough: Using Push Notifications to better support your mobile cl...Juan Gomez
 
Push vs pull Advantages & Disadvantages
Push vs pull Advantages & DisadvantagesPush vs pull Advantages & Disadvantages
Push vs pull Advantages & DisadvantagesSwapnil Gharde
 
Mobile Push Notifications
Mobile Push NotificationsMobile Push Notifications
Mobile Push NotificationsMike Willbanks
 
Study on Lean Manufacturing Process in Garments Production
Study on Lean Manufacturing Process in Garments ProductionStudy on Lean Manufacturing Process in Garments Production
Study on Lean Manufacturing Process in Garments ProductionMomin Uddin
 
Rich Internet Applications
Rich Internet ApplicationsRich Internet Applications
Rich Internet ApplicationsYoussef Shaath
 

En vedette (14)

Push notifications
Push notificationsPush notifications
Push notifications
 
Open Graph Protocol 2.0
Open Graph Protocol 2.0Open Graph Protocol 2.0
Open Graph Protocol 2.0
 
02 eContent
02 eContent02 eContent
02 eContent
 
E content mohammed shurrab
E content   mohammed shurrabE content   mohammed shurrab
E content mohammed shurrab
 
Pushing the web — WebSockets
Pushing the web — WebSocketsPushing the web — WebSockets
Pushing the web — WebSockets
 
Push notifications
Push notificationsPush notifications
Push notifications
 
OWD - Push Notification Server Architecture [DEVCON1_2012]
OWD - Push Notification Server Architecture [DEVCON1_2012]OWD - Push Notification Server Architecture [DEVCON1_2012]
OWD - Push Notification Server Architecture [DEVCON1_2012]
 
Push Notification
Push NotificationPush Notification
Push Notification
 
REST is not enough: Using Push Notifications to better support your mobile cl...
REST is not enough: Using Push Notifications to better support your mobile cl...REST is not enough: Using Push Notifications to better support your mobile cl...
REST is not enough: Using Push Notifications to better support your mobile cl...
 
Push vs pull Advantages & Disadvantages
Push vs pull Advantages & DisadvantagesPush vs pull Advantages & Disadvantages
Push vs pull Advantages & Disadvantages
 
Push Notification
Push NotificationPush Notification
Push Notification
 
Mobile Push Notifications
Mobile Push NotificationsMobile Push Notifications
Mobile Push Notifications
 
Study on Lean Manufacturing Process in Garments Production
Study on Lean Manufacturing Process in Garments ProductionStudy on Lean Manufacturing Process in Garments Production
Study on Lean Manufacturing Process in Garments Production
 
Rich Internet Applications
Rich Internet ApplicationsRich Internet Applications
Rich Internet Applications
 

Similaire à Php push notifications

All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS ExpressDavid Boyer
 
Building an inflight entertainment system controller in twisted
Building an inflight entertainment system controller in twistedBuilding an inflight entertainment system controller in twisted
Building an inflight entertainment system controller in twistedDavid Novakovic
 
Remote code execution in restricted windows environments
Remote code execution in restricted windows environmentsRemote code execution in restricted windows environments
Remote code execution in restricted windows environmentsBorja Merino
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch
 
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDNOpenStack Korea Community
 
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDNSungman Jang
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
Pushing Data from S7-1200 to Cloud
Pushing Data from S7-1200 to CloudPushing Data from S7-1200 to Cloud
Pushing Data from S7-1200 to CloudDMC, Inc.
 
Owin e o Projeto Katana
Owin e o Projeto KatanaOwin e o Projeto Katana
Owin e o Projeto KatanaAndre Carlucci
 
Websocket technology for XPages
Websocket technology for XPagesWebsocket technology for XPages
Websocket technology for XPagesCsaba Kiss
 
Network-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQNetwork-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQICS
 
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Julien Vermillard
 
Presentation Lfoppiano Pycon
Presentation Lfoppiano PyconPresentation Lfoppiano Pycon
Presentation Lfoppiano PyconLuca Foppiano
 
GNAT GPL For Mindstorms
GNAT GPL For MindstormsGNAT GPL For Mindstorms
GNAT GPL For MindstormsAdaCore
 
Digital design with Systemc
Digital design with SystemcDigital design with Systemc
Digital design with SystemcMarc Engels
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketMauricio "Maltron" Leal
 

Similaire à Php push notifications (20)

All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Building an inflight entertainment system controller in twisted
Building an inflight entertainment system controller in twistedBuilding an inflight entertainment system controller in twisted
Building an inflight entertainment system controller in twisted
 
Remote code execution in restricted windows environments
Remote code execution in restricted windows environmentsRemote code execution in restricted windows environments
Remote code execution in restricted windows environments
 
5.node js
5.node js5.node js
5.node js
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
[OpenStack 하반기 스터디] Interoperability with ML2: LinuxBridge, OVS and SDN
 
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
20151222_Interoperability with ML2: LinuxBridge, OVS and SDN
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Pushing Data from S7-1200 to Cloud
Pushing Data from S7-1200 to CloudPushing Data from S7-1200 to Cloud
Pushing Data from S7-1200 to Cloud
 
Owin e o Projeto Katana
Owin e o Projeto KatanaOwin e o Projeto Katana
Owin e o Projeto Katana
 
mqttvsrest_v4.pdf
mqttvsrest_v4.pdfmqttvsrest_v4.pdf
mqttvsrest_v4.pdf
 
Websocket technology for XPages
Websocket technology for XPagesWebsocket technology for XPages
Websocket technology for XPages
 
(C)NodeJS
(C)NodeJS(C)NodeJS
(C)NodeJS
 
Network-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQNetwork-Connected Development with ZeroMQ
Network-Connected Development with ZeroMQ
 
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
Iot Conference Berlin M2M,IoT, device management: one protocol to rule them all?
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
Presentation Lfoppiano Pycon
Presentation Lfoppiano PyconPresentation Lfoppiano Pycon
Presentation Lfoppiano Pycon
 
GNAT GPL For Mindstorms
GNAT GPL For MindstormsGNAT GPL For Mindstorms
GNAT GPL For Mindstorms
 
Digital design with Systemc
Digital design with SystemcDigital design with Systemc
Digital design with Systemc
 
Enhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocketEnhancing Mobile User Experience with WebSocket
Enhancing Mobile User Experience with WebSocket
 

Dernier

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Php push notifications

  • 1. PHP Push Notification System Mohammed S Shurrab CTO, Datrios.com CTO, UnitOne.ps
  • 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. 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. 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. 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. 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)