Created
August 3, 2017 22:22
-
-
Save clowestab/2cc4e8a07e7585438052368f48553cb5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Initialize | |
$this->client = new JAXL(array( | |
'jid' => $this->senderId .'@gcm.googleapis.com', | |
'pass' => $this->googleApiKey, | |
'auth_type' => 'PLAIN', | |
'host' => $this->host, | |
'port' => $this->port, | |
'strict' => false, | |
'force_tls' => true, | |
'log_level' => JAXL_DEBUG, | |
'protocol' => 'tls' | |
)); | |
//add a callback for authorisation success | |
$this->client->add_cb('on_auth_success', function() { | |
$this->client->set_status("available!", "dnd", 10); | |
//send your messages | |
$this->sendYourMessages(); | |
}); | |
//start the client | |
$this->client->start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment