Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EventStatus property to Event #410

Merged
merged 3 commits into from
Mar 27, 2022

Conversation

lucasribolli
Copy link
Contributor

@lucasribolli lucasribolli commented Feb 8, 2022

Android: https://developer.android.com/reference/android/provider/CalendarContract.EventsColumns#STATUS
iOS: https://developer.apple.com/documentation/eventkit/ekevent/1507158-status

This property is useful when the organizer provides a confirmation of the meeting to the attendees. There is more information about it in this link

In iOS it seems to be read only. That's the reason I add a platform verification in example, allowing EventStatus edition only in Android. But I am not sure if there is a way to edit the status property in iOS side.

I tested it in both platforms

@thomassth thomassth merged commit 7508c19 into builttoroam:develop Mar 27, 2022
@GoldenSoju
Copy link
Contributor

@lucasribolli @thomassth
One question regarding the event status on Android side.
After adding the EventStatus to the package, I get an error when I try to delete an instance of an event.
Error:
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

It doesn't matter when I try to delete an event completely, only when I try to delete an instance.
I got it solved by changing:

values.put(Events.STATUS, getEventStatus(event.eventStatus))

to

var status: Int? = getEventStatus(event.eventStatus)
if (status != null) {
   values.put(Events.STATUS, status)
}

(CalendarDelegate.kt 599)

So I guess, if we put the value Status with null, the error occurs, while not putting the Status value at all if null, it works fine.

I am wondering if someone else has experienced this behaviour?

@lucasribolli lucasribolli deleted the event-status branch July 1, 2022 13:24
@lucasribolli lucasribolli restored the event-status branch July 1, 2022 13:24
@lucasribolli
Copy link
Contributor Author

It sounds a no tested scenario and I unfortunately don't get this behavior. Maybe status is like recurrenceRule that needs to not be null to work as expected. You can make a PR fixing this as seem this property is not released yet. If you prefer, I can do it for you.

@GoldenSoju
Copy link
Contributor

I added the fix to another pull request. (Link)
It might be in connection with a different recurrence rule implementation.

@thomassth thomassth mentioned this pull request Oct 1, 2022
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants