React Native Firebase v6推送通知

时间:2020-08-12 12:35:32

标签: firebase react-native react-native-firebase

自方法以来,我想问一下如何在react natibe firebase v6中创建频道

const channel = new firebase.notifications.Android.Channel(
      'local',
      'local notification',
      firebase.notifications.Android.Importance.Max,
    );

不能用于v6。

1 个答案:

答案 0 :(得分:-1)

您可以按照this教程将推送通知添加到Android Apps。

要创建一个通知频道,我将以下两行添加到android/app/src/main/AndroidManifest.xml

<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_name"  
android:value="YOUR NOTIFICATION CHANNEL NAME"/>

<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_description" 
android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>

就像教程本身所说的那样