Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion assets/android/MessagingService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,13 @@ class MessagingService : FirebaseMessagingService(), OnInitListener {
val bitcoinDisplayMode = getBitcoinDisplayModeFromPreferences(this)
val formattedAmount = if (bitcoinDisplayMode == "bip177") "₿ $amount" else "$amount sats"

val descriptionText = notification.optString("description", "")
var descriptionText = notification.optString("description", "")
if (descriptionText.isBlank() || descriptionText == "null") {
descriptionText = notification.optJSONObject("metadata")
?.optString("comment", "")
?.takeIf { it.isNotBlank() && it != "null" }
?: ""
}
val hasDescription = descriptionText.isNotEmpty()

val action = when (notificationType) {
Expand Down
6 changes: 6 additions & 0 deletions assets/ios/NotificationService.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withConte
NSString *formattedAmount = isBip177 ? [NSString stringWithFormat:@"₿ %.0f", amountInSats] : [NSString stringWithFormat:@"%.0f sats", amountInSats];

NSString *descriptionText = notificationDict[@"description"];
if (![descriptionText isKindOfClass:[NSString class]] || descriptionText.length == 0) {
NSDictionary *metadata = notificationDict[@"metadata"];
if ([metadata isKindOfClass:[NSDictionary class]]) {
descriptionText = metadata[@"comment"];
}
}
BOOL hasDescription = [descriptionText isKindOfClass:[NSString class]] && descriptionText.length > 0;

NSString *notificationTitle = [notificationType isEqualToString:@"hold_invoice_accepted"]
Expand Down