jobstreet / js-push-notification
JS Push Notification SDK
Installs: 11 778
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.0
- guzzle/guzzle: ~3.7
Requires (Dev)
- phpunit/phpunit: 4.2.*
This package is not auto-updated.
Last update: 2024-12-14 17:41:59 UTC
README
JobStreet.com Push Notification Service
##Installation
Using Composer:
composer require jobstreet/js-push-notification 1.0.0
##Usage
This is the minimal example that you'll need to have:
require_once 'vendor/autoload.php';
$client = new JSPNClient(array(
'applicationId' => 'YOUR_APPLICATION_ID',
'isSandbox' => true
));
$response = $client->publishMessage(12345, 'This is the notification message', array(
'customParameter1' => 'parameter'
), array(
'notificationOptions' => 'options'
));
if($response == 1) {
echo 'Successfully publish message';
}
else {
echo 'Failed to publish message. Error message ' . $response->error->message;
}
##Configuration File You may want to create a client config file in other place. Here is the example of defining the config file:
define('JSPN_CONFIG_PATH', 'path/to/config.php');
require_once 'vendor/autoload.php';
$client = new JSPNClient();
config.php
return array(
'applicationId' => 'YOUR_APPLICATION_ID',
'isSandbox' => true
);
##Documentation
More information and example are available at JSPushNotification SDK Wiki