iOS - request PERMISSIONS.IOS.CALENDARS does not return the correct permission status #911
Closed
3 tasks done
Labels
bug
Something isn't working
Before submitting a new issue
Bug summary
Requesting the PERMISSIONS.IOS.CALENDARS and selecting 'Full Access' from the OS prompt returned a status code of 0 from [EKEventStore authorizationStatusForEntityType:EKEntityTypeEvent] in the completion handler resulting in 'denied' on the TS side. It seems as though for iOS17+ and the new method of requesting access, that the BOOL returned in the completion handler needs to be used to determine permission. I have modified the completion handler (screenshot below) and the request now returns the proper permission status based upon what is chosen in the OS prompt.
Additional Notes:
If I kept pressing the button in my app that calls the request function, after two or three times it would eventually return granted, but further requests to check or request the same permission would be inconsistent. After doing a bit of Google research, other examples of this workflow (requesting calendar permissions on iOS) only use a single instance of the EKEventStore instead of a new one each time a request for permission is made. Not sure if that is something worth exploring??
Other relevant env info:
iOS 18.1 physical iPhone 15 Pro
RN 0.76.3 new arch enabled
Library version
5.2.1
Environment info
Steps to reproduce
Reproducible sample code
The text was updated successfully, but these errors were encountered: