/** If the notification is an update. */ protected boolean isUpdate() { if (!options.getDict().has("updatedAt")) return false; long now = new Date().getTime(); long updatedAt = options.getDict().optLong("updatedAt", now); return (now - updatedAt) < 1000; }
/** Encode options to JSON. */ public String toString() { JSONObject dict = options.getDict(); JSONObject json = new JSONObject(); try { json = new JSONObject(dict.toString()); } catch (JSONException e) { e.printStackTrace(); } json.remove("updatedAt"); json.remove("soundUri"); json.remove("iconUri"); return json.toString(); }