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

Updated iOS Plugin to support IOS 17 #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrBasque
Copy link

@MrBasque MrBasque commented Feb 8, 2024

Support for iOS 17 which has a different implementation for calendar access levels
(Read Apple technotes for details)

This version actually awaits the dialog before it returns

Do not forget to add these entries to your Info.plist:

	<key>NSCalendarsFullAccessUsageDescription</key>
	<string>Read/Write appointments in device calendar</string>

@VittorioCineca
Copy link

I've tried this code but it doesn't work properly, still getting the same error.

I made it work with Digistorm fork:
https://github.com/digistorm/Calendar-PhoneGap-Plugin

@MrBasque
Copy link
Author

I've tried this code but it doesn't work properly, still getting the same error.

I made it work with Digistorm fork:

https://github.com/digistorm/Calendar-PhoneGap-Plugin

Thanks for leaving your feedback, good to know you found a proper solution that actually works :-). Tbh I've never experienced an error myself, it just did not open the calendar and/or the permissions dialog on iOS17+ and with the new code it does. I will have a look at the digistorm code, thanks.

@VittorioCineca
Copy link

Sorry. I made another attempt today and it works. Maybe yesterday I used a dirty project.
I'll try again tomorrow to be sure.

Can I eventually upload your code on another package on NPM (i.e. cordova-plugin-calendar-ios17fix) if @EddyVerbruggen don't accept this one?

@MrBasque
Copy link
Author

Can I eventually upload your code on another package on NPM (i.e. cordova-plugin-calendar-ios17fix) if @EddyVerbruggen don't accept this one?

Sure, I don't see why not. Thanks again, appreciate your heads up!

@VittorioCineca
Copy link

I confirm that it works.
I uploaded the PR on https://www.npmjs.com/package/cordova-plugin-calendar-ios-fix

I thank you for your fix...

@larsmagne
Copy link

larsmagne commented May 15, 2024

I've tried cordova-plugin-calendar-ios-fix, but I'm still getting the same error message as in the stock version: "No default calendar found. Is access to the Calendar blocked for this app?" I've added the NSCalendarsFullAccessUsageDescription stuff, but it seems to make no difference. (This is with iOS 17.5.)

Is there anything further one has to do these days on iOS than just call window.plugins.calendar.createEventInteractively()?

@MrBasque
Copy link
Author

MrBasque commented May 16, 2024

I've tried cordova-plugin-calendar-ios-fix, but I'm still getting the same error message as in the stock version: "No default calendar found. Is access to the Calendar blocked for this app?" I've added the NSCalendarsFullAccessUsageDescription stuff, but it seems to make no difference. (This is with iOS 17.5.)

Is there anything further one has to do these days on iOS than just call window.plugins.calendar.createEventInteractively()?

Probably not related to this pull-request or even plugin. Do you have a default calendar specified on your IOS device?:

Go to Settings > Calendar > Default Calendar. Select the calendar you want to use as your default calendar.

@larsmagne
Copy link

Ah, yes, you're right -- the problem was that the iPhone simulator doesn't have a calendar app at all installed. Everything works fine on an actual iPhone. Thanks for the help!

@hooliapps
Copy link

Hello

I also did a change (works on Prod for 200k users) for read/write, since months.

https://github.com/hooliapps/Calendar-PhoneGap-Plugin

Anybody can test it ? If ok, i will create a npmjs.

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.

4 participants