Use substring over replaceFirst (#4707)
This commit is contained in:
parent
ea4e21de93
commit
68457c5e7e
1 changed files with 6 additions and 1 deletions
|
|
@ -534,7 +534,12 @@ public class CustomPushNotification extends PushNotification {
|
|||
}
|
||||
|
||||
private String removeSenderNameFromMessage(String message, String senderName) {
|
||||
return message.replaceFirst(senderName, "").replaceFirst(": ", "").trim();
|
||||
Integer index = message.indexOf(senderName);
|
||||
if (index == 0) {
|
||||
message = message.substring(senderName.length());
|
||||
}
|
||||
|
||||
return message.replaceFirst(": ", "").trim();
|
||||
}
|
||||
|
||||
private void notificationReceiptDelivery(String ackId, String postId, String type, boolean isIdLoaded, ResolvePromise promise) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue