Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void getUnreadNotifications() {
- final String serviceUrlString =
- String.format(Locale.US, "%s?isRead=%b&name=%s&createdAt>%s",
- Environment.GET_GET_NOTIFICATIONS_URL_PATH,
- isRead,
- // StringUtils.stringUrlStringEncode(name),
- name,
- createdAt);
- StringRequest request = new StringRequest(Request.Method.GET,
- serviceUrlString,
- response -> {
- processResponse(new TaskManagerResponse(response, null));
- },
- error -> {
- CommonTasks.getInstance().logToServerTask(token,
- this.getClass().getSimpleName(),
- DateFormatter.getCurrentDate(),
- "error",
- error.getMessage());
- processResponse(new TaskManagerResponse(null, error));
- }) {
- @Override
- public Map<String, String> getHeaders() throws AuthFailureError {
- Map<String, String> params = null;
- if (Commons.isNotNull(token)) {
- params = new HashMap<>();
- params.put("Authorization", token);
- params.put("Content-Type", "application/json");
- }
- return params;
- }
- };
- try {
- sendRequest(request);
- } catch (InvalidObjectException ex) {
- processResponse(new TaskManagerResponse(null, ex));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement