this code is better:
#include <SPI.h>
#include <LoRa.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>

#define ss 15
#define rst 4
#define dio0 2

#define LORA_RECEIVE_TASK_STACK_SIZE 2048
#define LORA_RECEIVE_TASK_PRIORITY 5

volatile bool packetReceived = false;
volatile int packetSize = 0;
TaskHandle_t LoRaReceiveTaskHandle = NULL;

void IRAM_ATTR onReceive(int size) {
  packetReceived = true;
  packetSize = size;
  // Notify the LoRa receive task
  if (LoRaReceiveTaskHandle != NULL) {
    xTaskNotifyGive(LoRaReceiveTaskHandle);
  }
}

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("LoRa Receiver Callback");
  LoRa.setPins(ss, rst, dio0);
  LoRa.setSPIFrequency(6E6);
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }

  LoRa.onReceive(onReceive);
  LoRa.receive();

  // Create the LoRa receive task, but don’t start it immediately
  xTaskCreatePinnedToCore(loraReceiveTask, "LoRa_Receive_Task", LORA_RECEIVE_TASK_STACK_SIZE, NULL, LORA_RECEIVE_TASK_PRIORITY, &LoRaReceiveTaskHandle, 0);
}

void loop() {
  // In this example, loop() does nothing but letting background tasks run.
  // All packet processing is handled in loraReceiveTask().
  delay(1000);
}



void loraReceiveTask(void *parameter) {
  for (;;) {
    // Wait indefinitely for a notification from the onReceive ISR
    ulTaskNotifyTake(pdTRUE, portMAX_DELAY);

    if (packetReceived) {
      // Mark packet as processed
      packetReceived = false;

      Serial.print("Received packet ");

      for (int i = 0; i < packetSize; i++) {
        Serial.print((char)LoRa.read());
      }

      Serial.print(" with RSSI ");
      Serial.println(LoRa.packetRssi());

      LoRa.receive(); // Go back into receive mode
    }
  }
}

or below code:

// /*********
//   Modified from the examples of the Arduino LoRa library by nuttyengieer.com 
//   for more information write to <PRESIDIO_ANONYMIZED_EMAIL_ADDRESS> or info@nuttyengineer.com
// *********/
#include <SPI.h>
#include <LoRa.h>
// #define ss 10
// #define rst 9
// #define dio0 2

#define ss 15
#define rst 4
#define dio0 2

int counter = 0;

void setup() {
  //initialize Serial Monitor
  Serial.begin(9600);
  while (!Serial);
 Serial.println("LoRa Receiver AHHR ");

  //setup LoRa transceiver module
  LoRa.setPins(ss, rst, dio0);
  LoRa.setSPIFrequency(6E6);
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
  // LoRa.setSyncWord(0xF3);
  Serial.println("LoRa Initializing OK!");
  delay(1000);
}

void loop() {
  // try to parse packet
  int packetSize = LoRa.parsePacket();
  if (packetSize) {
    // received a packet
    Serial.print("Received packet ");
    // read packet
    while (LoRa.available()) {
      String LoRaData = LoRa.readString();
      Serial.print(LoRaData);
    }

    // print RSSI of packet
    Serial.print("' with RSSI '");
    Serial.println(LoRa.packetRssi());
  }
}
/*
  Create on March 17, 2021
  Create by MohammedDamirchi base of https://github.com/sandeepmistry/arduino-LoRa
  Home
*/

// #include <SPI.h>
// #include <LoRa.h>


// #define ss 15
// #define rst 4
// #define dio0 2


// void setup() {
//   Serial.begin(9600);
//   while (!Serial);
//   delay(500);
//   Serial.println("LoRa Receiver");
//   LoRa.setPins(ss, rst, dio0);
//   if (!LoRa.begin(433E6)) {
//     Serial.println("Starting LoRa failed!");
//     while (1);
//   }
//   Serial.println("Starting LoRa ok!");
// }

// void loop() {
//   // try to parse packet
//   int packetSize = LoRa.parsePacket();
//   if (packetSize) {
//     // received a packet
//     Serial.print("Received packet '");

//     // read packet
//     while (LoRa.available()) {
//       Serial.print((char)LoRa.read());
//     }

//     // print RSSI of packet
//     Serial.print("' with RSSI ");
//     Serial.println(LoRa.packetRssi());
//   }
// }