public void sendBroadCast(Lead lead) { Map categories = new HashMap(); categories.put("broadcast", "version=" + broadcastVersion++); // TODO manage the id Map json = new HashMap(); json.put("id", lead.getId()); json.put("messageType", "accepted_lead"); json.put("name", lead.getName()); json.put("location", lead.getLocation()); json.put("phone", lead.getPhoneNumber()); json.put("simple-push", categories); json.put("alert", "A new lead has been accepted"); defaultJavaSender.broadcast(json, pushApplicationId); }
public void sendLeads(List<String> users, Lead lead) { Map categories = new HashMap(); categories.put("lead", "version=" + leadVersion++); // //TODO manage the id Map json = new HashMap(); json.put("id", lead.getId()); json.put("messageType", "pushed_lead"); json.put("name", lead.getName()); json.put("location", lead.getLocation()); json.put("phone", lead.getPhoneNumber()); json.put("simple-push", categories); json.put("alert", "A new lead has been created"); defaultJavaSender.sendTo(users, json, pushApplicationId); }