FCM,检查交付是否成功

时间:2017-06-29 09:14:52

标签: java android firebase firebase-cloud-messaging

我创建了java rest api服务,我需要向Android设备发送推送通知,我的代码是

Pushraven.setKey("KEy");
        Notification raven = new Notification();
        raven.title(title)
             .text(message)
             .color("#ff0000")
             .to("User token");              
        FcmResponse response = Pushraven.push(raven);
        Pushraven.setNotification(raven);
        System.out.println("Respose: "+response.getResponseCode());
        raven.clear();

问题是,如何检查我的通知是否已成功传到设备,response.getResponseCode()始终返回200但有时消息未到设备

0 个答案:

没有答案