mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 03:16:24 +00:00
Skip notification if title empty
This commit is contained in:
parent
e9863417dd
commit
ac7c3bbdaa
@ -205,11 +205,16 @@ public class NotificationsService extends Service {
|
|||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
JSONArray results = new JSONArray(body);
|
JSONArray results = new JSONArray(body);
|
||||||
if (results.length() > 0) {
|
for (int i=0; i < results.length(); i++) {
|
||||||
JSONObject notification = results.getJSONObject(0);
|
JSONObject notification = results.getJSONObject(i);
|
||||||
Integer order_id = notification.getInt("order_id");
|
Integer order_id = notification.getInt("order_id");
|
||||||
|
String title = notification.getString("title");
|
||||||
|
|
||||||
displayOrderNotification(order_id, notification.getString("title"), coordinator);
|
if (title.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
displayOrderNotification(order_id, title, coordinator);
|
||||||
|
|
||||||
long milliseconds;
|
long milliseconds;
|
||||||
try {
|
try {
|
||||||
@ -223,6 +228,7 @@ public class NotificationsService extends Service {
|
|||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
editor.putLong(token, milliseconds);
|
editor.putLong(token, milliseconds);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
Loading…
Reference in New Issue
Block a user