Open hooliapps opened 1 year ago
I have the same issue. When fetching all calendars by window.plugins.calendar.listCalendars()
it returns an empty array. When using window.plugins.calendar.findEvent()
it returns the error No default calendar found. Is access to the Calendar blocked for this app?
There is a default calendar set and the app has full access to the calendars.
Fix for this problem can be found in this PR: https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/pull/566
Thanks a lot i will test asap.
I confirm that your solution + JS code work perfectly without changing anything in cordova.xml
I just need to changed my code to call your functions.
Tested on XCode 15 / iOS 17 / iPhone 13 Pro Max.
Not tested on any other version or XCode.
Finally, i retested by deleting the App then reisntalling with Testflight but dont works anymore.
I think we need to add new Permissions in cordova.
For the record, the cause of this are likely the changes in iOS 17 highlighted here.
For those using Capacitor, you might need to add NSCalendarsFullAccessUsageDescription
to Info.plist as well, although I haven't tried with the code in the PR yet.
The README states that for iOS10+ you need to provide a reason in the plist.
I've created a new pull request to address some of the issues.
Thanks @kallewangstedt for your original pull request which mine is based on.
My pull request also allows write only access to be requested for the calendar. However, this does create a potential issue where requests might fail if the following is done in this order:
I don't actually know how to write Objective C, so I would do a proper review and tests of my pull request.
I could solve the above issue if someone can explain the following to me:
Why is self.eventStore
used in some places:
https://github.com/sjregan/Calendar-PhoneGap-Plugin/blob/2b309a9ea7769f69bb40cae9552673a83187a1d6/src/ios/Calendar.m#L331C60-L331C71
e.g.
datedEvents = [self.eventStore eventsMatchingPredicate:[eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:calendars]];
And not others? https://github.com/sjregan/Calendar-PhoneGap-Plugin/blob/2b309a9ea7769f69bb40cae9552673a83187a1d6/src/ios/Calendar.m#L526
NSPredicate *fetchCalendarEvents = [eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:calendarArray];
Is this a bug, or a deliberate choice for some reason?
Hello, i installed the last XCode 15 on Ventura (ios min version 11) / iOS 17 / cordova-ios@7.0.1
Plugin don't crash but don't show any calendar.
I get the warning message "accept or not", but after list is empty.
Do you have any idea please ? (Worked since long time)
window.plugins.calendar.listCalendars(openCalendarsListSuccess, openCalendarsListError); I get openCalendarsListSuccess response, but the calendars list is empty.