\Gomoob\Pushwoosh\Model\RequestRegisterDeviceRequest

Class which represents Pushwoosh '/registerDevice' request.

Summary

Methods
Properties
Constants
create()
getApplication()
getDeviceType()
getHwid()
getLanguage()
getPushToken()
getTimezone()
setApplication()
setDeviceType()
setHwid()
setLanguage()
setPushToken()
setTimezone()
toJSON()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
checkDeviceType()
$application
$deviceType
$hwid
$language
$pushToken
$timezone
N/A

Properties

$application

$application : string

The Pushwoosh application ID for which one to register a new device.

Type

string

$deviceType

$deviceType : int

The device type, this attribute can take the following values : - 1 : iPhone - 2 : Blackberry - 3 : Android - 4 : Nokia - 5 : Windows Phone 7 - 7 : Mac

Type

int

$hwid

$hwid : string

The Unique string to identify the device (Please note that accessing UDID on iOS is deprecated and not allowed, one of the alternative ways now is to use MAC address).

Type

string

$language

$language : string

The language local of the device, this is a 2 letter local (for exempke "en").

Type

string

$pushToken

$pushToken : string

The push token associated to the device.

Type

string

$timezone

$timezone : int

A timezone offset in seconds for the device (optional).

Type

int

Methods

getApplication()

getApplication() : string

Gets the Pushwoosh application ID for which one to register a new device.

Returns

string —

the Pushwoosh application ID for which one to register a new device.

getDeviceType()

getDeviceType() : int

Gets the device type, this attribute can take the following values : - 1 : iPhone - 2 : Blackberry - 3 : Android - 4 : Nokia - 5 : Windows Phone 7 - 7 : Mac

Returns

int —

the device type.

getHwid()

getHwid() : string

Gets the Unique string to identify the device (Please note that accessing UDID on iOS is deprecated and not allowed, one of the alternative ways now is to use MAC address).

Returns

string —

the Unique string to identify the device (Please note that accessing UDID on iOS is deprecated and

    not allowed, one of the alternative ways now is to use MAC address).

getLanguage()

getLanguage() : string

Gets the language local of the device, this is a 2 letter local (for exempke "en").

Returns

string —

the language local of the device, this is a 2 letter local (for exempke "en").

getPushToken()

getPushToken() : string

Gets the push token associated to the device.

Returns

string —

the push token associated to the device.

getTimezone()

getTimezone() : int

Gets the timezone offset in seconds for the device (optional).

Returns

int —

the timezone offset in seconds for the device (optional).

setApplication()

setApplication(string $application) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the Pushwoosh application ID for which one to register a new device.

Parameters

string $application

the the Pushwoosh application ID for which one to register a new device.

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

setDeviceType()

setDeviceType(int $deviceType) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the device type, this attribute can take the following values : - 1 : iPhone - 2 : Blackberry - 3 : Android - 4 : Nokia - 5 : Windows Phone 7 - 7 : Mac

Parameters

int $deviceType

the device type to set.

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

setHwid()

setHwid(string $hwid) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the Unique string to identify the device (Please note that accessing UDID on iOS is deprecated and not allowed, one of the alternative ways now is to use MAC address).

Parameters

string $hwid

the Unique string to identify the device (Please note that accessing UDID on iOS is

   deprecated and not allowed, one of the alternative ways now is to use MAC address).

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

setLanguage()

setLanguage(string $language) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the the language local of the device, this is a 2 letter local (for exempke "en").

Parameters

string $language

the the language local of the device, this is a 2 letter local (for exempke "en").

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

setPushToken()

setPushToken(string $pushToken) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the push token associated to the device.

Parameters

string $pushToken

the push token associated to the device.

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

setTimezone()

setTimezone(int $timezone) : \Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

Sets the timezone offset in seconds for the device (optional).

Parameters

int $timezone

the timezone offset in seconds for the device (optional).

Returns

\Gomoob\Pushwoosh\Model\Request\RegisterDeviceRequest

this instance.

toJSON()

toJSON() : array

Creates a JSON representation of this request.

Returns

array —

a PHP which can be passed to the 'json_encode' PHP method.

checkDeviceType()

checkDeviceType()

Function used to check if the device type is configured and is valid.

Throws

\Gomoob\Pushwoosh\Exception\PushwooshException

if the device type is not configured or is not valid.