PHP code example of imdhemy / expo-notifications

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

    

imdhemy / expo-notifications example snippets


use Imdhemy\Expo\Client;
use Imdhemy\Expo\Messages\Message;
use Imdhemy\Expo\Messages\MessageList;

$tokens = [
    'ExponentPushToken[aaaaaaaaaaaaaaaaaaaaaa]',
    'ExponentPushToken[bbbbbbbbbbbbbbbbbbbbbb]',
];
$title = 'hello';
$body = 'world';

$message = new Message($title, $body);
$message->addManyPushTokens($tokens);

$list = MessageList::init()->addMessage($message);

$client = Client::create();
$tickets = $client->push($list);