public void createMessageNotification(final Context context, Intent resultIntent, String userEntityID, String title, String message) { int pushIcon = ChatSDK.config().pushNotificationImageDefaultResourceId; if(pushIcon <= 0) { pushIcon = R.drawable.icn_72_push_mask; } final int smallPushIcon = pushIcon; final Bitmap largePushIcon = BitmapFactory.decodeResource(context.getResources(), smallPushIcon); Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); if (userEntityID != null && !userEntityID.isEmpty()) { User user = StorageManager.shared().fetchUserWithEntityID(userEntityID); if (user != null) { ImageBuilder.bitmapForURL(context, user.getAvatarURL()).subscribe((bitmap, throwable) -> { if (throwable != null) { ChatSDK.logError(throwable); } if (bitmap == null) { bitmap = largePushIcon; } createAlertNotification(context, resultIntent, title, message, bitmap, smallPushIcon, alarmSound, -1); }); } else { createAlertNotification(context, resultIntent, title, message, largePushIcon, smallPushIcon, alarmSound, -1); } } }