In the release announcment for SDK 34 the following is listed under breaking changes:
“Calendar : the DEFAULT constant has been removed. To use the default calendar, pass null instead. This fixes an occasional issue when the calendar name coincides with a SQLite keyword.”
I’m trying to adjust my code to accomidate the changes, but I keep getting an error:
createEventAsync must be called with an id (string) of the target calendar
The way I’ve been replacing the code was from…
Calendar.createEventAsync(Calendar.DEFAULT, {//details in here...})
…to…
Calendar.createEventAsync(null, {//details in here...})
Is this what I’m supposed to change it to or am I missing something?
I wasn’t able to reproduce the error within the snack but by downloading this snack:
And installing it & all it’s dependancies and running the code. It doesn’t crash, it just prints the error to the cli. If it is relevant, I am testing on a Samsung A10 running Android 9.
It was suggested that I should use Calendar.createCalendarAsync(details) to make a Calendar whose id I can use to enter the events under. However, I’ve not been able to get it to create a Calendar on Android or iOS, does anyone here know what a details object should look like?
I have filled out all the fields in the snack above that are required according to the Calendar docs, but am still getting errors.