post https://cp.pushwoosh.com/json/1.3/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 code | status_code | Description |
---|---|---|
200 | 200 | Device successfully registered |
200 | 210 | Argument error. See status_message for more info |
400 | N/A | Malformed request string |
500 | 500 | Internal 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();
}