Can't add attendees to event.
See original GitHub issueI wanted to save event with attendees but my App is crashing when I am trying to add them. Event is saved successfully without attendees key.
This is the error I got in Android Studio.
com.facebook.react.bridge.NoSuchKeyException: url at com.facebook.react.bridge.ReadableNativeMap.getType(ReadableNativeMap.java:225) at com.calendarevents.CalendarEvents.createAttendeesForEvent(CalendarEvents.java:772) at com.calendarevents.CalendarEvents.addEvent(CalendarEvents.java:667) at com.calendarevents.CalendarEvents.access$200(CalendarEvents.java:44) at com.calendarevents.CalendarEvents$3.run(CalendarEvents.java:1225) at java.lang.Thread.run(Thread.java:919)
Environment
React Native Environment Info: System: OS: macOS 10.14.3 CPU: (4) x64 Intel® Core™ i5-5350U CPU @ 1.80GHz Memory: 17.86 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.0.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 Android SDK: API Levels: 23, 25, 27, 28, 29 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.2/10E125 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: ^0.59.1 => 0.59.1 npmGlobalPackages: react-native-cli: 2.0.1
Steps to Reproduce
let calevent = await RNCalendarEvents.saveEvent(eventTitle, { calendarId: this.state.calId, startDate: from_date, endDate: to_date, location: eventLocation, alarms: [{ date: 60 }], attendees: [{name: “User Name”, email: “user@email.com”}] });
Expected Behavior
I think there should be an option to add attendees while saving or updating an event. I tried both with no luck.
Actual Behavior
App crashing when I try to add attendees.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
Adding attendees as
attendees: [{name: "User Name", email: "user@email.com"}]
is not working because when i gone through the android native java files in library I see different keys are expected for objects in attendees array.library version I used: 1.7.3 File: react-native-calendar-events/android/src/main/java/com/calendarevents/CalendarEvents.java
`//region Attendees private void createAttendeesForEvent(ContentResolver resolver, int eventID, ReadableArray attendees) { … some logic
So it is expecting url and firstName as keys instead of name and email in each attendee object passed in array.
I tested with the following object and it worked on Android:
iOS: Doesn’t even parse attendees array in saving event method mentioned in file RNCalendarEvents.m
And they also mentioned attendees as read only in the documentation of this library.
Here it is. https://github.com/padabala/react-native-calendar-events.