Commit 74bec9a7 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Fixed not being able to read some customized notifications

Fixed error "Expected String but value was a android.text.SpannableString"
parent c4a87ecb
......@@ -292,9 +292,11 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
try {
Bundle extras = notification.extras;
String extraTitle = extras.getString(TITLE_KEY);
String extraText = extras.getString(TEXT_KEY);
String extraText = null;
Object extraTextExtra = extras.get(TEXT_KEY);
if (extraTextExtra != null) extraText = extraTextExtra.toString();
if (extraTitle != null && extraText != null) {
if (extraTitle != null && extraText != null && !extraText.isEmpty()) {
ticker = extraTitle + " ‐ " + extraText;
} else if (extraTitle != null) {
ticker = extraTitle;
......@@ -302,7 +304,7 @@ public class NotificationsPlugin extends Plugin implements NotificationReceiver.
ticker = extraText;
}
} catch(Exception e) {
Log.w("NotificationPlugin","problem parsing notification extras");
Log.w("NotificationPlugin","problem parsing notification extras for " + notification.tickerText);
e.printStackTrace();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment