/registerDevice

Called internally from SDK. Registers device for the application.

Possible device types:

  • 1 – iOS
  • 2 – BB
  • 3 – Android
  • 5 – Windows Phone
  • 7 – OS X
  • 8 – Windows 8
  • 9 – Amazon
  • 10 – Safari
  • 11 – Chrome
  • 12 – Firefox

📘

For emails call /registerEmail.

Status codes:

HTTP Status codestatus_codeDescription
200200Device successfully registered
200210Argument error. See status_message for more info
400N/AMalformed request string
500500Internal error
<?php
//see http://gomoob.github.io/php-pushwoosh/register-device.html
use Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest;

// creates request instance
$request = RegisterDeviceRequest::create()
    ->setDeviceType(DeviceType::iOS())
    ->setHwid('HWID')
    ->setLanguage('fr')
    ->setPushToken('xxxxxxxx')
    ->setTimezone(3600);

// call '/registerDevice' Web Service
$response = $pushwoosh->registerDevice($request);

if($response->isOk()) {
    print 'Ok, operation successful.';
} else {
    print 'Oups, the operation failed :-('; 
    print 'Status code : ' . $response->getStatusCode();
    print 'Status message : ' . $response->getStatusMessage();
}
Language
Click Try It! to start a request and see the response here!