PHP code example of getmo / smartpush-php-connector
1. Go to this page and download the library: Download getmo/smartpush-php-connector library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$info = $push->getInfo(string $pushid);
$data = json_decode($info);
var_dump($data->notifications); # array of information about all notifications of this push.
foreach ($data->notifications as $notification) {
echo $notification->appid;
echo $notification->status;
# if push was sent the follow property will be available.
echo $notification->sent_at;
}
...
# if push was configured to be sent at a future moment in time, this two properties will be available.
echo $data->{'time-left'};
echo $data->date;
'{...}'; # JSON string
$push->cancel(string $pushid);
# or
$info = $push->cancel(string $pushid);
# Here, $info get the same result as getInfo() mention above.
'{...}'; # JSON string
$push->hide(string $pushid);
# or
$info = $push->hide(string $pushid);
# Here, $info get the same result as getInfo() mention above.
'{...}'; # JSON string
$notification = new Notification(string $devid, string $appid, string $platform);