SDK 34 Calendar.DEFAULT changes

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...})


Calendar.createEventAsync(null, {//details in here...})

Is this what I’m supposed to change it to or am I missing something?

1 Like

Hey @lark,

Your implementation looks to be correct. Would you mind creating a github issue with a Snack that reproduces the error for this issue?


Hi Adam, thanks for your help!

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.

Sorry, just realised you asked me to create an issue, on that now!

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.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.