Download the PHP package getmo/smartpush-php-connector without Composer
On this page you can find all versions of the php package getmo/smartpush-php-connector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getmo/smartpush-php-connector
More information about getmo/smartpush-php-connector
Files in getmo/smartpush-php-connector
Package smartpush-php-connector
Short Description Php library to connect with Smartpush API services
License MIT
Homepage https://github.com/Getmo-Inc/Smartpush-Php-Connector
Informations about the package smartpush-php-connector
Smartpush PHP connector
Php library to connect with Smartpush API services.
Installation
Platforms
Use one of the these platforms when you see on the docs above.
Usage
Import the Push class into your project.
Class: Push
Description: Create a new push instance.
Example:
The second and thirth parameters are optional. The second parameter can handle this entry models: 'now', '0000-00-00 00:00:00', '00/00/000 00:00:00', or a valida UNIX timestamp. The thirth paramenter sets a custom name for this Push Notification, so you can track it later on control panel.
Method: setEnvironment()
Description: (Optional) Set the environment you want to use to sent this Push Notification.
Example:
Return:
This method is optional. If you dont set the environment, the lib will guess you choose . If you want to use , use this method with $environment = '0'.
Method: addNotification()
Description: Add a notification to the Push payload.
Example:
Return:
The thirth parameter, $params, must be an or an (If you pass in an array the lib will turn it into an object). The content schema variates according the platform. Consult the REST API docs to obtain the correct schema for the platform that you want to target.
Method: getNotifications()
Description: (Optional) Return an array of Notifications that you have previously configured to send.
Example:
Return:
This method can be used to inspect the Notifications data inside the Push object before sending.
Method: setFilterRange()
Description: (Optional) Set the range days of which the filter will operate when the job is processed. The $range value can be one of there: 7
, 15
, 30
, 60
, 90
, all
, otherwise it will fallback to default: all
.
Example:
Return:
Method: setFilterOperator()
Description: (Optional) Set the operator of which the filter will use to do comparisons. The $operator value can be one of there: AND
, OR
, otherwise it will fallback to default: AND
.
Example:
Return:
Method: addTag()
Description: Add a Tag to filter the Push Notification devices.
Example:
Return:
The thirth parameter is optional. If you suppress the parameter the lib will guess you want to (=) this entry. The complete list of comparators you find out in the REST API docs.
Method: getTags()
Description: (Optional) Return an of Tags that you have previously configured to send.
Example:
Return:
This method can be used to inspect the Notifications data inside the Push object before sending.
Method: getPayload()
Description: (Optional) Return the complete payload that you have previously configured to send. If you pass in the first parameter, the method will return a JSON string, otherwise an array.
Example:
Return:
This method can be used to inspect the data inside every notification before sending it.
Method: send()
Description: Send the Push Notification previously configured. If the inputs dont validate this methos will return , otherwise .
Example:
Return:
If this method return probably you forgot to config a notification or a tag.
Method: getResult()
Description: Grab the server response after send a Push Notification. One of the most important information that returns in the JSON string is the pushid.
Example:
Return:
Method: getInfo()
Description: Consult server for the status (and more information) about a Push Notification.
Example:
Return:
Method: cancel().
Description: Cancel and Consult server for the status (and more information) about a Push Notification.
Example:
Return:
You can only cancel Push Notifications which were not sent.
Method: hide().
Description: Cancel and Consult server for the status (and more information) about a Push Notification.
Example:
Return:
Class: Notification
Description: Create a new notification instance.
Example:
Method: getLastNotifications()
Description: Get the last ten (10) notifications of a specific hwid
.
Example:
Return:
The second parameter, $options, is optional. It must be an and can have the following keys:
show
,startingDate
,dateFormat
. Consult the REST API docs to get more information about there optional arguments.
Method: getLastUnreadNotifications()
Description: Get the last ten (10) unread notifications of a specific hwid
(device).
Example:
Return:
The second parameter, $options, is optional. It must be an and can have the following keys:
show
,startingDate
,dateFormat
. Consult the REST API docs to get more information about there optional arguments.
Method: getExtraPayload()
Description: Get the extra payload for a specific pushid
.
Example:
Return:
Method: readOneNotification()
Description: Mark one Push Notification as READ for a specific hwid
(device).
Example:
Method: readAllNotifications()
Description: Mark all Push Notifications as READ for a specific hwid
(device).
Example:
Method: hideHwidNotification()
Description: Hide one Push Notification for a specific hwid
(device).
Example:
Support
Jonathan Martins, [email protected]
Developed by Getmo