php-pushwoosh

A PHP Library to easily send push notifications with the Pushwoosh REST Web Services.

View project onGitHub
Search

/setBadge

Remote API Guide link
Method /setBadge

Signature
SetBadgeResponse setBadge(SetBadgeRequest $setBadgeRequest)

<?php
use Gomoob\Pushwoosh\Model\Request\SetBadgeRequest;

// Creates the request instance
$request = RegisterDeviceRequest::create()
    ->setBadge(5)
    ->setHwid('HWID');

// Call the '/setBadge' Web Service
$response = $pushwoosh->setBadge($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
?>