@react原生火力/消息传递 如何自定义通知?



根据文档: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);

如何自定义?

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

根据此声明并参考文档,反应原生Firebase版本6 +消息传递仅支持云集成和简单的通知显示。

如果在显示通知时需要额外的配置,则应使用任何其他本地通知库,例如"Notifee">

最新更新