arter/amos-expo

There is no license information available for the latest version (dev-master) of this package.

Yii2 extension for working with Expo push notifications

Installs: 83

Dependents: 0

Suggesters: 0

Security: 0

Type:yii2-extension

dev-master 2022-05-04 16:00 UTC

This package is auto-updated.

Last update: 2024-04-04 20:05:15 UTC


README

Yii2 extension for working with Expo push notifications

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist open2/amos-expo "*"

or add

"open2/amos-expo": "*"

to the require section of your composer.json file.

Config

Once the extension is installed, add it to your config file(main.php) :

'expo' => [
            'class' => 'open2\expo\ExpoPush'
        ],

Usage

$data = [
    'title' => 'Some title',
    'text' => 'Some text'
];
$notification = ['body' => $text, 'data' => $data];
\Yii::$app->expo->notify('ExponentPushToken[xxxxxxxxxxxxx]', $notification);

$data is optional