diff --git a/assets/android/MessagingService.kt b/assets/android/MessagingService.kt index af0c68e..6478712 100644 --- a/assets/android/MessagingService.kt +++ b/assets/android/MessagingService.kt @@ -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) { diff --git a/assets/ios/NotificationService.m b/assets/ios/NotificationService.m index 33e6066..8a6e0bf 100644 --- a/assets/ios/NotificationService.m +++ b/assets/ios/NotificationService.m @@ -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"]