首页 > 解决方案 > 令人敬畏的 fcm 推送通知

问题描述

我在某些时候迷路了,我试图弄清楚如何在这里使用这个插件插件 应该用什么来回复这个:

这在 fcm 上工作得很好,但我正试图从 fcm 切换,因为像 whatsApp 这样的回复

FirebaseMessaging.onMessage.listen
FirebaseMessaging.onMessageOpenedApp.listen
FirebaseMessaging.instance
.getInitialMessage()
.then((RemoteMessage message) {
});

标签: flutterdart

解决方案


您可以使用操作按钮:

AwesomeNotifications().createNotification(
          content: NotificationContent(
              id: 10,
              channelKey: 'basic_channel',
              title: 'Action button title',
              body: 'Simple body',
              
              ),
          actionButtons: [
            NotificationActionButton(
                key: "REPLY",
                label: "Reply",
                autoCancel: true,
                enabled: true,
                buttonType: ActionButtonType.InputField,
                icon: "resource://drawable/logo"),
          ],
        );

推荐阅读