[FIX] Server Test Push Notification (#1508)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-01-07 14:50:11 -03:00 committed by Diego Mello
parent f681a3e33f
commit 1aadb88392
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ public class CustomPushNotification extends PushNotification {
}
notificationMessages.get(notId).add(message);
super.postNotification(Integer.parseInt(notId));
super.postNotification(notId != null ? Integer.parseInt(notId) : 1);
notifyReceivedToJS();
}
@ -91,7 +91,7 @@ public class CustomPushNotification extends PushNotification {
.setDefaults(Notification.DEFAULT_ALL)
.setAutoCancel(true);
Integer notificationId = Integer.parseInt(notId);
Integer notificationId = notId != null ? Integer.parseInt(notId) : 1;
notificationChannel(notification);
notificationIcons(notification, bundle);
notificationStyle(notification, notificationId, bundle);

View File

@ -14,7 +14,7 @@ public class Ejson {
private SharedPreferences sharedPreferences = RNUserDefaultsModule.getPreferences(CustomPushNotification.reactApplicationContext);
public String getAvatarUri() {
if (!type.equals("d")) {
if (type == null || !type.equals("d")) {
return null;
}
return serverURL() + "/avatar/" + this.sender.username + "?rc_token=" + token() + "&rc_uid=" + userId();