0

I'm trying to save a blob as name.ics, but for some reason on iPhone they all get saved as name.ics.txt

This is the code

  // Creating event template for ICS file
  const event = {
    start: startAt,
    end: endAt,
    title: !location ? "Appointment " + appointment.appointmentType + " " + appointment.sessionName : "Appointment",
    description: "Your Practitionier: " + appointment.practitionerName,
    location: !location ? appointment.locationName + ", " + addressString + ", " + postalCode : location,
    status: "CONFIRMED",
    alarms: [
      {
        action: "display",
        description: "Appointment",
        trigger: { hours: reminder.hours, minutes: reminder.minutes, before: true },
      },
    ],
  };

  // Event handlers
  const handleSave = () => {
    createEvent(event, (error, value) => {
      const blob = new Blob([value], { type: "text/plain;charset=utf-8" });
      saveAs(blob, "event-schedule.ics");
    });
  };
Stefan
  • 13
  • 2

0 Answers0