Push Server
Structure

Any requests to the PushServer have to be POST requests with the Authentication credentials in the header parameters and further information in the body in form of a JSON object.
The Push Server uses GCM for sending Push Notifications to Android and IOS devices. (see Google Cloud Messaging)
Therefore Android and IOS devices must implement the GCM Client:
IOS
Android
Upon installation the App must connect to GCM Service and receive a GCM Id, also from time to time the GCM Id will be renewed by GCM Service.
This must be followed by the App registering the new GCM Id at the Push Server by using the registerDevice call.(see 2.1 register device)
Request:
Method : POST
Base Path : to be defined
Request Path : registerDevice
Headers : Auth Headers (see 1.Authentification)

Body:
{
    "data" : {
        "gcmId" : String,                       //"3q907654v9ß28736..." contains the received GcmId
        "deviceCountryCode" : String,           //2 digit lowercased countrycode  e.g. "de"
        "utcOffset" : integer,                  // difference of the local time set on device vs.
                                                        //UTC time rounded to full hours(integer)
        "appId" : String ,                      // Identification of the sender App (MOD / AOD ...)
        "os" : String                           //operating system (Android / IOS)
    }
}


Response:
upon receiving an internal error, the app should execute the registerDevice request on the next startup of the app.
Body:
{
    "data" : {
        "result" : "success / internalError"
    }
}                          
The App must implement a Listener to be aware of changes regarding the system time. Upon a change of the system time, the device will update the utcOffset that was saved by the registerDevice request. (2.1) The request for updating the utcOffset is the same as for registering a new device. If the gcmId allready exists in the databse, the parameters will be updated.
The GCM Service will send downstream messages(HTTP) to the Client Apps, where the app has to handle the message and show it to the user.
(see downstream messages)
passed parameters:
{
    "priority" : "high",
    "data" : {
        "title" : String,
        "body" : String,
        "dealId" : integer
    }
}                            
passed parameters:
{
    "content_available" : "true",
    "priority" : "high",
    "notification" : {
        "title" : String,
        "body" : String,
        "dealId" integer
    }
}                            
The Queue Manager receives Push Notifications from the different App Backends. He stores the neccessary information in the database and executes the Push Notification at the desired time. For sending a request the method addTask is used.
Request:
Method : POST
Base Path : to be defined
Request Path : addTask
Headers : Auth Headers (see 1.Authentification)

Body:
{
	"data" : {
		"dealid"                            //identifies the Deal
		"appid" : String,                   // Identification of the sender App (MOD / AOD ...)
		"countrycode" : String,             //2 digit countrycode  e.g. "de"
		"pushtime" : "1452008784",          // the desired time for the push notification in utc
		"taskid" : integer,                 // unique id for identifying and if wished updating the task
		"os" : String,                      //operating system (Android / IOS)
		"environment" : String,             //dev or prod
		"notification_title" : String,      //push notification title
		"notification_body"	: String    //push notification body
	}
}                           


Response:
The response can be displayed to the user
Body:
{
    "data": {
        "result": {
            "queueId": int     //cakeId for Queues Entitys
        }
    }
}
In the following the steps to configure a new Backend to use the PushServer are explained.
Codesamples are valid for CakePHP2 and are taken from the Movie of the day backend.
These are the needed params. The params in RED are different from App to App and need to be configured accordingly.
/**
 * Custom Configurations for Album of the day Plugin
 */

	/**
	 * Configurations for the Pushserver
	 */

	// PushServer Base Url
	Configure::write('AOD.pushserver.basePath','http://pushserver.sme-dev.com/');

	//Path to PushServer method addTask
	Configure::write('AOD.pushserver.addTask','/queues/addTask');


	Configure::write('AOD.pushserver.appid','mod');
	Configure::write('AOD.pushserver.notification_title','Film des Tages');
	Configure::write('AOD.pushserver.environment','prod');

	// set Secret for communication with pushserver
	Configure::write('AOD.pushserver.backendSecret','1234567898765432123456798765432123465798876543212345678987654321');
Request:
//get Header Information for PushServer Security
$security = $this->_getSecurityHeaders();

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Content-Type: application/json",
    "X-PushServer-backendTime: ".$security['time'],
    "X-PushServer-backendName: " . $security['appId'],
    "X-PushServer-backendSecret: ".$security['backendSecret'],
    "X-PushServer-backendToken: ".$security['backendToken']
));
Request:
$request = array(
    'data' => array(
        'dealid' => $x, //int specifies the dealid which appears in AOD and MOD
        'appid' => Configure::read('AOD.pushserver.appid'),
        'countrycode' => $country, // de/en...
        'pushtime' => $pushDate,  //Datetime Onject specifiying the date and time the push is supposed to happen
        'os' => $this->SmePushServerPlatform,
        'environment' => Configure::read('AOD.pushserver.environment'),
        'notification_title' => Configure::read('AOD.pushserver.notification_title'),
        'notification_body' => $pushText
    )
);