PHP code example of vasadibt / yii2-onesignal

1. Go to this page and download the library: Download vasadibt/yii2-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/ */

    

vasadibt / yii2-onesignal example snippets


'components' => [
    'onesignal' => [
        'class' => '\vasadibt\onesignal\OneSignal',
        'appId' => 'your-app-id-hash-code',
        'appAuthKey' => 'SetYourAppAuthKey',
        'userAuthKey' => 'SetYourUserAuthKey',
        'enabled' => YII_ENV_PROD ? true : false,
    ],
],


Yii::$app->onesignal->apps->getAll();

Yii::$app->onesignal->devices->getOne('asd-asd-asd-asd-asd-asd');
Yii::$app->onesignal->devices->getAll();


Yii::$app->onesignal->notifications->add([
    '