Open jayeshpansheriya opened 4 years ago
Is this with an event that was created through the plugin? What account type is it (office365, Gmail etc) and what device type (iOS or Android)?
Is this with an event that was created through the plugin? => yes i have used plugin device_calendar: ^3.1.0
its iphone inbuild calendar. List of calendar screen i selected Calendar named and i have also checked is not read only
i have also try to make demo app from your github example, same issues face in ios device. i am used selected ios calendar from list of calendar screen, with out add attendees is working fine.
i have again try to copy example from https://github.com/builttoroam/device_calendar/tree/develop/example. but face same issues
[599] Device calendar plugin ran into an issue. Platform specific exception [500], with message :Attendees cannot be changed., has been thrown.
@jayeshpansheriya Does everything work fine with 4.x version!?
@andzejsw nop still an opened issue. I'm facing same error.
I think I saw it too, but since I could add events just fine I didn't think it was important.
Is there any notable problem when handling attendees on iOS? Or is the only issue the warning in console (ie not urgent to fix)?
I think it's because EkParticipant: EventKit cannot add participants to an event nor change participant information. Use the properties in this class to get information about a participant.
While the Event's creation it seems to be unharmful, during the Event editing it just can't play with attendees. In the SwitfDeviceCalendarPlung.swift there is code that tries to manipulate attendees:
private func setAttendees(_ arguments: [String : AnyObject], _ ekEvent: EKEvent?) {
let attendeesArguments = arguments[attendeesArgument] as? [Dictionary<String, AnyObject>]
if attendeesArguments == nil {
return
}
var attendees = [EKParticipant]()
for attendeeArguments in attendeesArguments! {
let name = attendeeArguments[nameArgument] as! String
let emailAddress = attendeeArguments[emailAddressArgument] as! String
let role = attendeeArguments[roleArgument] as! Int
let attendanceStatus = attendeeArguments[attendanceStatusArgument] as! Int
if (ekEvent!.attendees != nil) {
let existingAttendee = ekEvent!.attendees!.first { element in
return element.emailAddress == emailAddress
}
if existingAttendee != nil && ekEvent!.organizer?.emailAddress != existingAttendee?.emailAddress{
attendees.append(existingAttendee!)
continue
}
}
let attendee = createParticipant(
name: name,
emailAddress: emailAddress,
role: role)
if (attendee == nil) {
continue
}
attendees.append(attendee!)
}
ekEvent!.setValue(attendees, forKey: "attendees")
}
Halo, I'm facing same issue with device_calendar: ^4.2.0 on iOS device version 15,4, is any update to this issue?
We should have new ways to handle attendants properly now
And the demo has included the new iOS specific popup for attendants
Still facing the same problem. Running on device_calendar 4.2.0.
Dug into this a bit and found a possible workaround here: https://stackoverflow.com/questions/30627694/modifying-ekparticipants-attendees-in-eventkit-like-sunrise ...which is the trick MaksMaxx is mentioning above, but this "trick" seems already to be done in setAttendees metod of the SwiftDeviceCalendarPlugin.swift, but it still does not fly. But found another clue in the small printed comments of the above link: "Don't try it in simulator .it's not working in simulator .... it worked for me in device ." ...and that was true in my case as well. I get the error in the simulator, but not when I run it on my device. So for me it is "problem solved".
I am facing a similar issue. I'm not updating the attendees. But I am trying to update an event that I have created using the plugin. The functionality works as expected on iOS but returns the following error on Android device. The android device I am using is OnePlus Nord 2.
PlatformException(500, Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference, null, null)
Device calendar plugin ran into an issue. Platform specific exception [500], with message :"Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference", has been thrown.
Following is my json of event data:
{calendarId: 1, eventId: 833, eventTitle: Appointment, eventDescription: , eventStartDate: 1678027560000, eventStartTimeZone: Asia/Kolkata, eventEndDate: 1678031160000, eventEndTimeZone: Asia/Kolkata, eventAllDay: false, eventLocation: Eiffel Tower, eventURL: null, availability: BUSY, eventStatus: null, reminders: [{minutes: 60}]}
I have the same issue by replacing the code below in CalendarDelegate.kt fixed the problem.
private fun getEventStatus(eventStatus: EventStatus?): Int? = when (eventStatus) { EventStatus.CONFIRMED -> Events.STATUS_CONFIRMED EventStatus.TENTATIVE -> Events.STATUS_TENTATIVE EventStatus.CANCELED -> Events.STATUS_CANCELED else -> 0 }
Submit a PR and I'll merge it :)
@thomassth Is this issue has been resolved or not yet? I was trying in the Ios 17 emulator and I faced the same issue.
I also had the same issue. I solved it by adding eventStatus value when updating the event. If eventStatus is something other than these values: EventStatus.CONFIRMED , EventStatus.TENTATIVE ,EventStatus.CANCELED it is not working because the getEventStatus is not returning value in else as @FelixYew has mentioned above about replacing it.
in android simulator app is working fine, but when i test it in ios simulator without attendees is working fine but when i add attendees it showen exception,
[599] Device calendar plugin ran into an issue. Platform specific exception [500], with message :Attendees cannot be changed., has been thrown.