1. Go to this page and download the library: Download mirovit/onesignal library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mirovit / onesignal example snippets
default, if a token is not passed in the constructor,
// the class will try to load the token from
// ONESIGNAL_API_KEY environment variable. The second param,
// the API endpoint is set as default value to
// https://onesignal.com/api/v1, which is the current endpoint:
$sdk = new Mirovit\OneSignal\OneSignal();
// or explicitly them:
$sdk = new Mirovit\OneSignal\OneSignal(
'rest api key',
'api endpoint'
);
// Retrieve player
$user = $sdk
->players()
->get('player-id', ['app_id' => 'app-id']);