Gcm Message

category Zend
package Zend_Mobile
subpackage Zend_Mobile_Push
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
version $Id$
inherited_from \Zend_Mobile_Push_Message_Abstract

 Methods

Add Data

addData(string $key, string $value) : \Zend_Mobile_Push_Message_Gcm

Parameters

$key

string

$value

string

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

Add a Token

addToken(string $token) : \Zend_Mobile_Push_Message_Gcm

Parameters

$token

string

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

Clear Data

clearData() : \Zend_Mobile_Push_Message_Gcm

Returns

\Zend_Mobile_Push_Message_Gcm

Clear Tokens

clearToken() : \Zend_Mobile_Push_Message_Gcm

Returns

\Zend_Mobile_Push_Message_Gcm

Get Data

getData() : array

Returns

array

Get Delay While Idle

getDelayWhileIdle() : boolean

Returns

boolean

Get Message ID

getId() : integer | string | float | boolean
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::getId()

Returns

integerstringfloatbooleanScalar

Get Token

getToken() : string
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::getToken()

Returns

string

getToken()

getToken() : 
magic
method

Returns

Get time to live

getTtl() : integer

Returns

integer

Set Data

setData(array $data) : \Zend_Mobile_Push_Message_Gcm

Parameters

$data

array

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

Set Delay While Idle

setDelayWhileIdle(boolean $delay) : \Zend_Mobile_Push_Message_Gcm

Parameters

$delay

boolean

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

Set Message ID

setId(integer|string|float|boolean $id) : \Zend_Mobile_Push_Message_Abstract
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::setId()

Parameters

$id

integerstringfloatboolean

Scalar

Exceptions

\Exception

Returns

\Zend_Mobile_Push_Message_Abstract

Set Options

setOptions(array $options) : \Zend_Mobile_Push_Message_Abstract
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::setOptions()

Parameters

$options

array

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Abstract

Set Token

setToken(string|array $token) : \Zend_Mobile_Push_Message_Gcm
inherited_from \Zend_Mobile_Push_Message_Abstract::setToken()

Parameters

$token

stringarray

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

Set Token

setToken(string $token) : \Zend_Mobile_Push_Message_Abstract
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::setToken()

Parameters

$token

string

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Abstract

Set time to live.

setTtl(integer $secs) : \Zend_Mobile_Push_Message_Gcm

Parameters

$secs

integer

Exceptions

\Zend_Mobile_Push_Message_Exception

Returns

\Zend_Mobile_Push_Message_Gcm

To Json utility method Takes the data and properly assigns it to a json encoded array to match the Gcm format.

toJson() : string

Returns

string

Validate this is a proper Gcm message Does not validate size.

validate() : boolean
inherited_from \Zend_Mobile_Push_Message_Abstract::validate()

Returns

boolean

Validate Message format

validate() : boolean
Inherited
inherited_from \Zend_Mobile_Push_Message_Interface::validate()

Returns

boolean

 Properties

 

Data key value pairs

$_data : array

Default

array()
 

Delay while idle

$_delay : boolean

Default

false
 

Id

$_id : integer | string | float | boolean

Default

 

Tokens

$_token : array

Default

array()
inherited_from \Zend_Mobile_Push_Message_Abstract::_token
 

Token

$_token : string

Default

 

Time to live in seconds

$_ttl : integer

Default

2419200