我在Android应用中注册了GoogleSamples后的通知频道https://github.com/googlesamples/android-NotificationChannels
但是,如何从RemoteMessage获取通知通道ID,因此我可以将其设置为NotificationBuilder.
public class FirebaseMessagingService extends com.google.firebase.messaging.FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage remoteMessage)
{
//int id = remoteMessage.getNotificationChannel(); // -something like this I could not find
}
Run Code Online (Sandbox Code Playgroud)
我在RemoteMessage对象中找到了这个值
value [3] ="notification_channel_system",因此我可以使用键值android_channel_id https://firebase.google.com/docs/cloud-messaging/http-server-ref将值设置为firebase推送通知,但我无法得到它被设备接收.
如何从PushNotification获取此ID并将其设置为通知构建器?