Skip to content

Commit 0382c91

Browse files
authored
Merge pull request #5 from ker0x/hotfix/readme
[n/a] update README
2 parents 9172e97 + eacb6a8 commit 0382c91

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,30 @@ You will then need to:
4242
* run `composer install` to get these dependencies added to your vendor directory
4343
* add the autoloader to your application with this line: `require('vendor/autoload.php');`
4444

45+
## Basic usage
46+
47+
```php
48+
use Kerox\Fcm\Api\Send;
49+
use Kerox\Fcm\Model\Message;
50+
use Kerox\Fcm\Model\Message\Notification;
51+
52+
// Create a notification
53+
$notification = new Notification('Hello World');
54+
$notification->setBody('My awesome Hello World!');
55+
56+
// Create the message
57+
$message = new Message($notification);
58+
$message->setData([
59+
'data-1' => 'Lorem ipsum',
60+
'data-2' => '1234',
61+
'data-3' => 'true'
62+
]);
63+
$message->setToken('1');
64+
65+
// Send the message and get the response
66+
$response = $fcm->send()->message($message);
67+
```
4568

4669
## Documentation
4770

48-
The documentation is available [here](http://fcm.readthedocs.org/en/latest/)
71+
The documentation is available [here](https://github.com/ker0x/fcm/wiki)

0 commit comments

Comments
 (0)