PHP Class Endroid\Gcm\Client

Show file Open project: endroid/gcm Class Usage Examples

Protected Properties

Property Type Description
$apiKey string
$apiUrl string
$browser Buzz\Browser
$client Buzz\Client\MultiCurl
$registrationIdMaxCount string
$responses Buzz\Message\Response[]

Public Methods

Method Description
__construct ( $apiKey, null $apiUrl = null ) Class constructor.
getResponses ( ) : Buzz\Message\Response[] Returns the responses.
send ( mixed $data, array $registrationIds = [], array $options = [] ) : boolean Sends the message via the GCM server.
sendTo ( mixed $data, string $topic = '/topics/global', array $options = [] ) : boolean Sends the data to the given registration token, notification key, or topic via the GCM server.

Protected Methods

Method Description
getHeaders ( ) : array Returns the headers.

Method Details

__construct() public method

Class constructor.
public __construct ( $apiKey, null $apiUrl = null )
$apiKey
$apiUrl null

getHeaders() protected method

Returns the headers.
protected getHeaders ( ) : array
return array

getResponses() public method

Returns the responses.
public getResponses ( ) : Buzz\Message\Response[]
return Buzz\Message\Response[]

send() public method

Sends the message via the GCM server.
public send ( mixed $data, array $registrationIds = [], array $options = [] ) : boolean
$data mixed
$registrationIds array
$options array
return boolean

sendTo() public method

Sends the data to the given registration token, notification key, or topic via the GCM server.
public sendTo ( mixed $data, string $topic = '/topics/global', array $options = [] ) : boolean
$data mixed
$topic string The value must be a registration token, notification key, or topic. Default global topic.
$options array to add along with message, such as collapse_key, time_to_live, delay_while_idle
return boolean

Property Details

$apiKey protected property

protected string $apiKey
return string

$apiUrl protected property

protected string $apiUrl
return string

$browser protected property

protected Browser,Buzz $browser
return Buzz\Browser

$client protected property

protected MultiCurl,Buzz\Client $client
return Buzz\Client\MultiCurl

$registrationIdMaxCount protected property

protected string $registrationIdMaxCount
return string

$responses protected property

protected Response[],Buzz\Message $responses
return Buzz\Message\Response[]