<?php

//ini_set('display_errors', 1);

include "NotificationHub.php";
$ConnectionString = "Endpoint=sb://heinzelmann.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=IIpgFEq+szZvP0TLHorqmNmLqxzXSTimdv5kZYaagHA=";
$HubName = "FCS";

$Message = "Hallo vom Heinzelmann -Ö_!";
$TicketID = rand(1, 2);

$hub = new NotificationHub($ConnectionString, $HubName);
$message_iOS = sprintf('{"aps":{"message":"%s", "ID": "%u", "date":"%s"}}', $Message, $TicketID, date("d.m.Y H:i"));
$message_Android = sprintf('{"data":{"message":"%s", "ID": "%u", "date":"%s"}}', $Message, $TicketID, date("d.m.Y H:i"));

$notification = new Notification("apple", $message_iOS);
$notification_Android = new Notification("gcm", $message_Android);

$Tag = sprintf('(%u && %s)', 53, md5(utf8_encode('FAIR COMPUTER TESTSYSTEMS GMBH')));
$res = $hub->sendNotification($notification);
//$res2 = $hub->sendNotification($notification_Android, $Tag);

echo "<br/>message_iOS: $message_iOS";
echo "<br/>message_Android: $message_Android";
echo "<br/>Tag: $Tag";
echo "<br/>Gesendet";

exit;
