普通通知生成器不会在Android O上显示通知.
如何在Android 8 Oreo上显示通知?
是否有任何新代码要添加以在Android O上显示通知?
我有火力点云信息的问题,我从设备获取的令牌,并不过,在透过谷歌火力地堡通知控制台发送通知测试,该通知从未登录,也被推到了Android的虚拟设备.对于FCM的文档几乎一模一样,我有以下及一些其它在还有什么你必须做的就是推送通知与火力的工作方式的代码.我已经完成了所有的设置信息了(的build.gradle增加,安装谷歌播放服务等)的文件中规定,但仍然没有消息产生.我按下通知后立即收到一次性错误,指出"I/FA:找不到标签管理器,因此不会被使用",但这是唯一输出的数据,我没有找到与标签相关的任何内容经理要求和谷歌上的FCM.我没有收到对logcat或设备的推送通知的代码有什么问题?请让我知道任何有用的进一步信息.谢谢.
NotificationGenie.java
public class NotificationGenie extends FirebaseMessagingService {
private static final String TAG = "Firebase_MSG";
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
// TODO(developer): Handle FCM messages here.
// If the application is in the foreground handle both data and notification messages here.
// Also if you intend on generating your own notifications as a result of a received FCM
// message, here is where that should be initiated. See sendNotification method below.
sendNotification(remoteMessage.getNotification().getBody());
Log.d(TAG, "From: " + remoteMessage.getFrom());
Log.d(TAG, "Notification …Run Code Online (Sandbox Code Playgroud) android firebase google-cloud-messaging firebase-cloud-messaging
我在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并将其设置为通知构建器?