-
Notifications
You must be signed in to change notification settings - Fork 52
/
test.php
35 lines (28 loc) · 988 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* @author Chris Schalenborgh <[email protected]>
* @version 0.1
*/
include('Pushover.php');
$push = new Pushover();
$push->setToken('app token goes here');
$push->setUser('user token goes here');
$push->setTitle('Hey Chris');
$push->setMessage('Hello world! ' .time());
$push->setUrl('http://chris.schalenborgh.be/blog/');
$push->setUrlTitle('cool php blog');
$push->setDevice('iPhone');
$push->setPriority(2);
$push->setRetry(60); //Used with Priority = 2; Pushover will resend the notification every 60 seconds until the user accepts.
$push->setExpire(3600); //Used with Priority = 2; Pushover will resend the notification every 60 seconds for 3600 seconds. After that point, it stops sending notifications.
$push->setCallback('http://chris.schalenborgh.be/');
$push->setTimestamp(time());
$push->setDebug(true);
$push->setSound('bike');
$go = $push->send();
$receipt = $push->getReceipt();
echo '<pre>';
print_r($go);
print "Receipt: $receipt\n";
echo '</pre>';
?>