PHP Class paragraph1\phpFCM\Client

Author: palbertini
Inheritance: implements paragraph1\phpFCM\ClientInterface
Show file Open project: paragraph1/php-fcm Class Usage Examples

Public Methods

Method Description
injectHttpClient ( GuzzleHttp\ClientInterface $client )
send ( Message $message ) : Psr\Http\Message\ResponseInterface sends your notification to the google servers and returns a guzzle repsonse object containing their answer.
setApiKey ( string $apiKey ) : Client add your server api key here read how to obtain an api key here: https://firebase.google.com/docs/server/setup#prerequisites
setProxyApiUrl ( string $url ) : Client people can overwrite the api url with a proxy server url of their own

Private Methods

Method Description
getApiUrl ( )

Method Details

injectHttpClient() public method

public injectHttpClient ( GuzzleHttp\ClientInterface $client )
$client GuzzleHttp\ClientInterface

send() public method

sends your notification to the google servers and returns a guzzle repsonse object containing their answer.
public send ( Message $message ) : Psr\Http\Message\ResponseInterface
$message Message
return Psr\Http\Message\ResponseInterface

setApiKey() public method

add your server api key here read how to obtain an api key here: https://firebase.google.com/docs/server/setup#prerequisites
public setApiKey ( string $apiKey ) : Client
$apiKey string
return Client

setProxyApiUrl() public method

people can overwrite the api url with a proxy server url of their own
public setProxyApiUrl ( string $url ) : Client
$url string
return Client