-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathexample.php
More file actions
50 lines (35 loc) · 906 Bytes
/
example.php
File metadata and controls
50 lines (35 loc) · 906 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
<?php
// Push The notification with parameters
require_once('PushBots.class.php');
$pb = new PushBots();
// Application ID
$appID = '518d187xx';
// Application Secret
$appSecret = '25e8507956b62d81xxx';
$pb->App($appID, $appSecret);
// Notification Settings
$pb->Alert("test Mesage");
$pb->Platform(array("0","1"));
$pb->Badge("+2");
// Update Alias
/**
* set Alias Data
* @param integer $platform 0=> iOS or 1=> Android.
* @param String $token Device Registration ID.
* @param String $alias New Alias.
*/
$pb->AliasData(1, "APA91bFpQyCCczXC6hz4RTxxxxx", "test");
// set Alias on the server
$pb->setAlias();
// Push it !
$pb->Push();
// Push to Single Device
// Notification Settings
$pb->AlertOne("test Mesage");
$pb->PlatformOne("0");
$pb->TokenOne("3dfc8119fedeb90d1b8a9xxxxxx");
//Push to Single Device
$pb->PushOne();
//Remove device by Alias
$pb->removeByAlias("myalias");
?>