showLiveActivitiesNotification method

Future<void> showLiveActivitiesNotification(
  1. String body,
  2. String msgId,
  3. String url
)

Implementation

Future<void> showLiveActivitiesNotification(
    String body, String msgId, String url) async {
  await createNotificationChannel();

/*    // Check if the provided URL is valid; if not, set a default URL
  if (url.isEmpty || !Uri.parse(url).isAbsolute) {
    url = "https://www.leewaysoftech.com/";
  }

  // Parse the JSON string
  String jsonString = body;
  if (jsonString.startsWith("\"") && jsonString.endsWith("\"")) {
    jsonString = jsonString.substring(1, jsonString.length - 1);
  }

  jsonString = jsonString
      .replaceAll(r'\"', '"')
      .replaceAll(r'\\', '\\')
      .replaceAll(r'\/', '/');

  Map<String, dynamic> jsonObject = json.decode(jsonString);
  String type = jsonObject['type'];

  switch (type) {
    case "Air India":
      await _showAirIndiaNotification(jsonObject, msgId, url);
      break;
    case "Match":
      await _showMatchNotification(jsonObject, msgId, url);
      break;
    case "busticket":
      await _showBusTicketNotification(jsonObject, msgId, url);
      break;
    default:
      // Handle unknown notification type
      break;
  }*/
}