tidev/titanium-sdk

iOS 17 requires calendar full access permission to read from calendar

narbs opened this issue · 2 comments

narbs commented

I have searched and made sure there are no existing issues for the issue I am filing

  • I have searched the existing issues

Description

To write to the calendar in iOS 17, the app now requires a new info.plist entry NSCalendarsFullAccessUsageDescription and needs to implement EKEventStore requestFullAccessToEventsWithCompletion.

Without this, building on iOS 17 using the existing requestAccessToEntityType:completion denies access to the calendar.

So this method needs to be implemented on iOS 17, replacing the iOS 16 approach, to restore existing functionality.

Expected Behavior

When the NSCalendarsFullAccessUsageDescription is added to the Info.plist, and Ti.Calendar.requestCalendarPermissions is called, the app should request full access to the calendar in iOS 17.

Actual behavior

What happens now is the app restricts all access to the calendar. On iOS 17, requestAccessToEntityType:completion just calls the completion block with an error. The new EKEventStore method requestFullAccessToEventsWithCompletion needs to be called on iOS 17 instead.

Reproducible sample

This call will now fail every time on iOS 17:

Ti.Calendar.requestCalendarPermissions(function(e) {
Ti.API.info('requestCalendarPermissions: ' + JSON.stringify(e));
if (e.success) {
Ti.API.info('requestCalendarPermissions success...');
} else {
Ti.API.info('requestCalendarPermissions failure...');
}
});

Steps to reproduce

Call the above requestCalendarPermissions code on iOS 17, when building for iOS 17.

Platform

iOS

SDK version you are using

12.3.0

Alloy version you are using

N/A

m1ga commented

@hansemannn should this be backported to 12_2_x too?

Yep, just added that one and the ioslib update.