mirror of
https://github.com/c0de-archive/telegram-pusher.git
synced 2025-01-02 12:32:40 +00:00
add push.js framework
This commit is contained in:
parent
813970db79
commit
b325525060
10
index.php
10
index.php
@ -2,6 +2,8 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Pusher Test</title>
|
<title>Pusher Test</title>
|
||||||
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
|
<script src="https://js.pusher.com/4.1/pusher.min.js"></script>
|
||||||
|
<script src="https://raw.githubusercontent.com/Nickersoft/push.js/master/bin/push.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// Enable pusher logging - don't include this in production
|
// Enable pusher logging - don't include this in production
|
||||||
@ -14,14 +16,16 @@
|
|||||||
|
|
||||||
var channel = pusher.subscribe('<?php echo $_GET['channel']; ?>');
|
var channel = pusher.subscribe('<?php echo $_GET['channel']; ?>');
|
||||||
channel.bind('my-event', function(data) {
|
channel.bind('my-event', function(data) {
|
||||||
alert(data.message);
|
Push.create(data.message);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
Your notify link: <a href="https://dev.c0defox.es/push/?channel=<?php echo $_GET['channel']; ?>">Get Notified</a>
|
Your notify link: <a href="https://dev.c0defox.es/push/?channel=<?php echo $_GET['channel']; ?>">Get Notified</a>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
Leave this page open on your phone and go about your day.<br />
|
Leave this page open on your phone and go about your day.<br />
|
||||||
When the person who created this push channel writes a message, you will get a notification
|
When the person who created this push channel writes a message, you will get a notification
|
||||||
|
Loading…
Reference in New Issue
Block a user