如何知道收件人收到Gcm消息?

时间:2016-06-07 05:29:02

标签: android

我是Android的新手,我在android中使用 GCM 。我希望获得已发送的消息的状态。

我的代码如下所示。

  private void sendMessage(List<SearchChildrenInformationData> searchedChildrensList) {
            {
                try {
                    Sender sender = new Sender(GOOGLE_SERVER_KEY);
                    Message message = new Message.Builder().timeToLive(50)
                            .delayWhileIdle(false).addData(MESSAGE_KEY, senderMessage)
                            .build();

                    for (int i = 0; i <= searchedChildrensList.size() - 1; i++) {
                        String regid = searchedChildrensList.get(i).getSchoolId();
                        Result multiResult = sender
                                .send(message, regid, 1);
                        System.out.println("#####REsult++++" + multiResult);

                    }
                    searchedChildrensList.clear();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

`

0 个答案:

没有答案