open20/amos-expo

Yii2 extension for working with Expo push notifications

Installs: 130

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Type:yii2-extension

1.1.1 2020-05-27 09:59 UTC

This package is auto-updated.

Last update: 2024-02-29 03:59:12 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 open20/amos-expo "*"

or add

"open20/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' => 'open20\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