-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
executable file
·52 lines (32 loc) · 1.19 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include __DIR__ . "/vendor/autoload.php";
$title = 'Title';
$message = 'Hello!';
$androidDeviceToken = "APA91bEArdlAAMqGrcXtxWYZFue30fSVKiVSVqnXiCyK2AI2ZBTHclI-biWJShtDWi0lmwNTkB6fCPWvvDIcOYBIUbdvU9dPdNwWAeRwLxyE_gRP2FUdSGkB901wpA0_1pG0ikuTpTeeJKiIe2f2-z67hjUlhlv97D2dRdZq-3gmr2soXlkzs7gqYGzSHW8k62_WRFpkkOpM";
$iOSDeviceToken = '3b24e2b4ed3e92e59428eeadab2cee972d6aa14184b133fad09d48e62a3d48b6';
$iOSPassphrase = 'pass';
$androidApiKey = "AIzaSyAkBcScJJ_MWswDRYm7y_qptno-KuwKo65";
// Android pusher
// for Google Cloud Messaging
$androidPusher = new AndroidPusher\Pusher($androidApiKey);
$androidPusher->notify($androidDeviceToken, [
"message" => $message,
"title" => $title,
]);
// for Firebase Cloud Messaging
$androidPusher = new AndroidPusher\Pusher($androidApiKey, null, true);
$androidPusher->notify($androidDeviceToken, [
"message" => $message,
"title" => $title,
]);
//print_r($androidPusher->getOutputAsArray());
// iOS pusher
$iOSPusher = new iOSPusher\Pusher($iOSPassphrase);
$iOSPusher->notify($iOSDeviceToken, [
"alert" => [
"title" => $title,
"body" => $message,
],
"sound" => "default",
]);
//print_r($iOSPusher->getOutputAsArray());