File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments