pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/wbbaddons/Push

/> GitHub - wbbaddons/Push: Push provides an easy to use push server API. · GitHub
Skip to content

wbbaddons/Push

Repository files navigation

Push

Push is an abstract open source push library for WoltLab Community Framework. It provides an easy to use API for both, PHP and JavaScript and allows swapping out the underlying push backend.

How to use

On the server

<?php
$pushHandler = \wcf\system\push\PushHandler::getInstance();

// second parameter can contain an integer array with userIDs.
// when leaving it empty, the message will be sent to all connected clients.
$pushHandler->sendMessage('be.bastelstu.wcf.push.hello', array());
?>

On the client

require([ 'Bastelstu.be/_Push' ], function (Push) {
	Push
	.onConnect(function () { alert('CONNECT') })
	.catch(function (err) { console.log(err) })

	Push
	.onDisconnect(function () { alert('DISCONNECT') })
	.catch(function (err) { console.log(err) })

	Push
	.onMessage('be.bastelstu.wcf.push.hello', function () { alert('World!') })
	.catch(function (err) { console.log(err) })
})

Writing your own push backend

Have a look at nodePush!

License

For licensing information refer to the LICENSE file in this folder.

About

Push provides an easy to use push server API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy