amiriun / pushe
php wrapper for pushe.co push notification
dev-master
2018-02-20 17:19 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.2@dev
Requires (Dev)
- phpunit/phpunit: ^5.3
This package is not auto-updated.
Last update: 2025-04-13 07:16:13 UTC
README
Instalation
To install via Composer , use the command bellow:
composer require amiriun/pushe
Usage
use \Amiriun\Pushe\Configuration; use \Amiriun\Pushe\Filter; use \Amiriun\Pushe\Pushe; // Firstly,you have to set your configuration Configuration::make()->setToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); Configuration::make()->setIsAsync(true); Configuration::make()->setApplicationsPackageName(["com.example.myApp"]); // If you'd like to filter push to some users with some parameters you can use filter: $filter = (new Filter()) ->byInstanceId(['xxxxx','yyyyy']) // Filter by instance id of web push users ->byAndroidId(['xxx','yyy']) // Filter by android id of android users ->byBrand(['lg']) // Filter by mobile's brand of users ->byOperator(['mci']) // Filter by users who has specify operator ->byMobileNetwork(['lte']) // Filter by network of users ->byPushIdOrIMEI('nnnnn'); // Filter by user's push id or imei // Finally you can fill your notification data to send $pushe = new Pushe(); $pushe->setTitle('titr') ->setContent('badane') ->filter($filter) // optional ->setVisible() // optional ->send();