Yii2 Mobile (Android, ios) push notifications extension
Installation
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist fgh151/yii2-push "*"
or add, (*3)
"fgh151/yii2-push": "*"
to the require section of your composer.json
file., (*4)
Usage
Once the extension is installed, simply add it in your config by :, (*5)
Basic config/web.php
, (*6)
Advanced [backend|frontend|common]/config/main.php
, (*7)
'modules' => [
'push' => [
'class' => 'fgh151\modules\push\Module',
],
...
...
],
<?php
include_once 'class.push.php';
$push = new pushmessage();, (*8)
$params = array("pushtype"=>"android", $idphone=>"android_smart_phone_id_here", $mst=>"Hello, an android user");
$rtn = $push->sendMessage($params);
//print_r($rtn);, (*9)