How do we add event or appointment in iPhone calendar?

Hi,

We wanted to add and appointment or event in native iPhone calendar on click of some button. we did some googling and fund that by adding eventKit from apple we can do it but i am not getting a way to add the event kit and VoltMx project.

Does anyone know how to add and appointment/event in native iPhone calendar?

Thanks

Rajat

Have you tried voltmx.phone.addCalendarEvent API?

https://opensource.hcltechsw.com/volt-mx-docs/95/docs/documentation/Iris/iris_api_dev_guide/content/voltmx.phone_functions.html

Hi @Subhajit Saha ,

Thank you for the reply, I tried with this but app crashes all the time and event is not recorded.

I am trying with below code

var date = '28' + '/' + '07' + ' / ' + '2023';
var stime = '02' + ":" + '30' + ":" + '30';
var startTime = date + " " + stime;
var ftime = '04' + ":" + '32' + ":" + '45';
var finishTime = date + " " + ftime;

var evtobj = {
summary: "Event started",
start: startTime,
finish: finishTime,
alarm: 40,
access: "public"
};
voltmx.phone.addCalendarEvent(evtobj);

Let me know if I am missing something or please share the working code snippet if you have.

Thanks

Rajat

Hi Varun,

Crash can be due to various reasons. You can start by checking logs to find out the root cause.

My first guess is that required permissions might be missing.

For iOS using a Calendar requires you to add "Privacy — Calendars Usage Description" in info plist.

For Android, it must have both the READ_CALENDAR and WRITE_CALENDAR permissions