https://github.com/symfony/firebase-notifier
Symfony Firebase Notifier Bridge
https://github.com/symfony/firebase-notifier
component firebase notifier php symfony symfony-component
Last synced: about 1 year ago
JSON representation
Symfony Firebase Notifier Bridge
- Host: GitHub
- URL: https://github.com/symfony/firebase-notifier
- Owner: symfony
- License: mit
- Created: 2020-02-10T15:38:24.000Z (over 6 years ago)
- Default Branch: 7.2
- Last Pushed: 2024-11-29T09:08:08.000Z (over 1 year ago)
- Last Synced: 2025-03-30T13:09:53.177Z (about 1 year ago)
- Topics: component, firebase, notifier, php, symfony, symfony-component
- Language: PHP
- Homepage: https://symfony.com/notifier
- Size: 96.7 KB
- Stars: 11
- Watchers: 5
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Firebase Notifier
=================
Provides [Firebase](https://firebase.google.com) integration for Symfony Notifier.
DSN example
-----------
```
FIREBASE_DSN=firebase://USERNAME:PASSWORD@default
```
where:
- `USERNAME` is your Firebase username
- `PASSWORD` is your Firebase password
Adding Interactions to a Message
--------------------------------
With a Firebase message, you can use the `AndroidNotification`, `IOSNotification` or `WebNotification` classes to add
[message options](https://firebase.google.com/docs/cloud-messaging/xmpp-server-ref.html).
```php
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\Bridge\Firebase\Notification\AndroidNotification;
$chatMessage = new ChatMessage('');
// Create AndroidNotification options
$androidOptions = (new AndroidNotification('/topics/news', []))
->icon('myicon')
->sound('default')
->tag('myNotificationId')
->color('#cccccc')
->clickAction('OPEN_ACTIVITY_1')
// ...
;
// Add the custom options to the chat message and send the message
$chatMessage->options($androidOptions);
$chatter->send($chatMessage);
```
Resources
---------
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)