On this page
OneSignal Integration
You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules
NOTE: The following documentation applies only to the Drupal 7 version of this module.
This module integrates with OneSignal, which is a free multi-platform push notification service for mobile apps.
This module wraps the PHP library written by @norkunas providing a simple user interface to setup the basic configurations to initialize the OneSignal class.
NOTE: This is not an end user module. This is for developers.
Requirements
This module depends on Composer Manager to deal with the external library mentioned above so you don't have to download it manually. Please check its documentation to know how to install properly.
Installation
You only need to run this drush command:
drush en -y onesignal
It will download and install all dependent libraries.
How to use
Once you installed the module, you can use this function in your code to initialize the OneSignal class:
$config = onesignal_initialize();
$api = new OneSignal($config);
Now you can use $api object to handle the whole API. You can see some examples in the PHP library documentation:
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion