Skip to content

Commit f888483

Browse files
committed
Make trunacated messages end in "..." to indicate that message has more on iOS
1 parent c2b392b commit f888483

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/ble/AppleNotificationCenterClient.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,12 @@ void AppleNotificationCenterClient::OnNotification(ble_gap_event* event) {
349349
notifStr += decodedMessage;
350350
}
351351

352+
// Adjust notification if too long
353+
if (notifStr.size() > 100) {
354+
notifStr.resize(97);
355+
notifStr += "...";
356+
}
357+
352358
notif.message = std::array<char, 101> {};
353359
std::strncpy(notif.message.data(), notifStr.c_str(), notif.message.size() - 1);
354360

0 commit comments

Comments
 (0)