【问题标题】:@react-native-firebase/messaging how to customize notification?@react-native-firebase/messaging 如何自定义通知?
【发布时间】:2020-07-05 20:05:37
【问题描述】:

根据文档:https://rnfirebase.io/messaging/usage 我想显示来自 firebase 但具有自定义配置的背景通知,例如自定义图标、自定义数据和点击通知时的自定义功能。

// index.js
import { AppRegistry } from 'react-native';
import messaging from '@react-native-firebase/messaging';
import App from './App';

// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
  console.log('Message handled in the background!', remoteMessage);
});

AppRegistry.registerComponent('app', () => App);

如何自定义?

【问题讨论】:

    标签: firebase react-native notifications customization message


    【解决方案1】:

    https://github.com/invertase/react-native-firebase/issues/3826#issuecomment-648903659

    根据此声明并参考文档,react native firebase 6+ 消息传递仅支持云集成和简单的通知显示。

    如果您在显示通知时需要额外配置,您应该使用任何其他本地通知库,例如“Notifee”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-28
      • 2021-03-12
      • 2019-02-22
      • 1970-01-01
      • 1970-01-01
      • 2021-01-19
      • 1970-01-01
      • 2021-03-27
      相关资源
      最近更新 更多