use of com.google.android.gcm.server.Message in project divide by HiddenStage.
the class PushEndpoint method sendMessageToDevice.
private String sendMessageToDevice(String email, String input) throws ServerDAO.DAOException, IOException {
Credentials user = getUserByEmail(dao, email);
Sender sender = new Sender(keyManager.getPushKey());
Message message = new Message.Builder().addData("body", input).build();
MulticastResult result = sender.send(message, Arrays.asList(user.getPushMessagingKey()), 5);
System.out.println("Result = " + result);
return result.toString();
}
Aggregations