Download the PHP package level51/silverstripe-onesignal without Composer
On this page you can find all versions of the php package level51/silverstripe-onesignal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download level51/silverstripe-onesignal
More information about level51/silverstripe-onesignal
Files in level51/silverstripe-onesignal
Package silverstripe-onesignal
Short Description Silverstripe module wrapper for OneSignal PHP SDK
License MIT
Informations about the package silverstripe-onesignal
Silverstripe OneSignal
Silverstripe module wrapper for OneSignal PHP SDK.
Provides a class OneSignalService
for creating/sending notifications.
Use convenience classes Notification
and NotificationResponse
for handling request and response payload.
Requirements
- Silverstripe ^4.0
- OneSignal PHP SDK
norkunas/onesignal-php-api
- PSR-18 HTTP client (e.g.
symfony/http-client
) - PSR-17 HTTP factories (e.g.
nyholm/psr7
)
Installation
Documentation
The module is based on the OneSignal API for PHP.
At the moment, only the Notifications API is being used.
This project adheres PSR-2.
Config
Two env vars and one config value are mandatory when initializing OneSignalService
.
OneSignalException
is thrown if not configured properly.
Environment
Define the following vars in your .env
file.
ONESIGNAL_AUTH_KEY
(defined on account/profile level)ONESIGNAL_APP_AUTH_KEY
Since the auth keys are sensitive data, it's recommended to not have them included in any VCS.
Config API
app_id
Example:
Usage
Send a simple notification.
Make sure to provide a supported locale for addHeading()
and addContent()
.
Maintainer
- Julian Scheuchenzuber [email protected]
All versions of silverstripe-onesignal with dependencies
norkunas/onesignal-php-api Version ^2.1
symfony/http-client Version ^5.1
nyholm/psr7 Version ^1.3