So our app uses the calendars API and everything worked fine on a device running iOS 12, however, once I upgraded to iOS 13 I noticed that the ExpoCalendar.getCalendarsAsync() function just wasn’t working at all.
An exception was thrown while calling `ExpoCalendar.getCalendarsAsync` with arguments `(
"<null>"
)`: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:104:55 in <unknown>
- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:4 in __invokeCallback
- ... 4 more stack frames from framework internals
This is the error that I’m constantly getting, I once had it not give me this error, but it then gave me an empty array (which isn’t the case either).
I’ve checked permissions and everything, I even upgraded all packages (expo-calendar) but still no luck there.
import * as ExpoCalendar from 'expo-calendar';
await ExpoCalendar.requestPermissionsAsync();
const localCalendars = await ExpoCalendar.getCalendarsAsync();
I also couldn’t find anyone else that had the problem, so that’s why I’m posting, been Googling for a while now.
Is this within the Expo client or a standalone app?
Does it make a difference if you try it on the Simulator vs. a real device?
If you have a minimal reproduction recipe then it would probably be best to create an issue in the expo repository on GitHub.
@evotec Try this, I recently found this out, does this help resolve the issue for you? Just try and reconnect all the accounts that you’ve connected as well as the subscribed calendars.
Okay I’ve got some more information, my agenda was being fetched from Google. It all works fine in the Calendar app, but I thought let’s just remove the Google account and reconnect it. And well, it actually worked… now I don’t really know if we’re able to reproduce this issue and if it’s an issue in the Expo SDK or if it’s an Apple bug…
@evotec how did you disable and enable? Did you go to passwords and accounts, remove the account and re-add it there? Because that’s what I meant, (in settings of your iPhone)