symfony/firebase-notifier

Symfony Firebase Notifier 桥接器

安装量: 647,552

依赖者: 3

建议者: 0

安全性: 0

星标: 10

关注者: 6

分支: 10

类型:symfony-notifier-bridge


README

为 Symfony Notifier 提供 Firebase 集成。

DSN 示例

FIREBASE_DSN=firebase://USERNAME:PASSWORD@default

where

  • USERNAME 是您的 Firebase 用户名
  • PASSWORD 是您的 Firebase 密码

向消息添加交互

使用 Firebase 消息,您可以使用 AndroidNotificationIOSNotificationWebNotification 类来添加 消息选项

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);

资源