It allows you to send notifications you created via Apps.ionic.io with PHP.
Ionic Profile Name and Auth Key required for construction function.
$setArray = [
'profileName' => 'your-profile-name',
'AuthKey' => 'your-auth-key'
];
Set your devices
$devices = ['your-device-tokens'];
$notifyConfig = [
'title' => "Your push title",
"message" => "your push message!",
"android" => [
'title' => "Your push title",
"message" => "your push message!",
"sound" => "your-sound-src" // default
],
"ios" => [
'title' => "Your push title",
"message" => "Your push title",
"sound" => "your-sound-src" // default
]
];
$IonicPush = new IonicPush($setArray);
$IonicPush -> getDevices($devices);
$IonicPush -> setNotificationArray($notifyConfig);
if ($IonicPush -> send()){
echo 'Push sent!';
}else {
print_r ( $IonicPush -> err );
}