FCM抬头通知 [英] FCM heads up notification

查看:75
本文介绍了FCM抬头通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试了所有论坛,但仍然无法正常使用.抬头通知无法正常工作.

Tried all forums, but still can't make it work. Heads up notification is not working.

尝试了最高优先级并振动了全屏内容,但没有任何效果.使用Android-Moto 5.1版本.

Tried max and high priority and vibrate full screen content, nothing is working. Using Android-Moto 5.1 version.

notificationBuilder.setDefaults(Notification.DEFAULT_ALL);
notificationBuilder.setPriority(Notification.PRIORITY_HIGH);

推荐答案

最后,我找到了解决方案.在cordova-fcm插件MyFireBaseMessagingService.java文件中的onMessageReceived方法中-注释以下行(发送通知).

Finally, i found the solution. In cordova-fcm plugin MyFireBaseMessagingService.java file onMessageReceived method - below line is commented(send notification).

sendNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody(), remoteMessage.getData());

希望它可以帮助某人.我取消了这一行的评论,并添加了可以正常工作的优先级.

Hope it helps someone. I uncommented this line and added the priority it works fine.

这篇关于FCM抬头通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆