【发布时间】:2018-11-20 10:46:25
【问题描述】:
我知道如何在 Android 应用中创建通知和通知通道。
我展示了许多示例,说明当您从 FCM 侦听器生成通知时创建通知通道。因此,当应用在此时收到通知时,它会生成频道。
但我在许多应用程序中看到,它创建所有频道而没有收到任何通知。
问题:我们应该从哪里创建通知渠道?
【问题讨论】:
-
FirebaseMessagingService.java 中的 onMessageReceived 内部
-
我在我的应用程序
onCreate()期间亲自创建了我的。在 Google Notifications sample 他们在 MainActivity 中创建它。 -
@AL。如果您注意到Google notification sample,它会在生成通知的同时创建一个频道。
标签: android firebase push-notification firebase-cloud-messaging