2017-07-28 112 views
0

尝试过所有论坛,但仍无法使其正常工作。抬头通知不起作用。FCM抬头通知

试过最高和最高优先级并振动全屏幕内容,没有任何工作。使用Android-Moto 5.1版本。

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

回答

0

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

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

希望它可以帮助别人。我取消了这一行的注释,并添加了它工作正常的优先级。