EddyVerbruggen / Calendar-PhoneGap-Plugin

:date: Cordova plugin to Create, Change, Delete and Find Events in the native Calendar
774 stars 403 forks source link

Support for iOS 17 #567

Open sjregan opened 8 months ago

sjregan commented 8 months ago

Fixes permission requests in iOS 17. Allows write only calendar access to be requested.

matfantinel commented 8 months ago

I can confirm these changes fixed the issue on my case (I manually replaced the content of the Calendar.h/.m files to test)

hooliapps commented 7 months ago

Hello i tested and i confirm that callbacks are now ok. (full perm mode)

But, i needed to add this code:

<!-- iOS 17 -->
<preference name="CALENDARS_FULL_ACCESS_USAGE_DESCRIPTION" default=" " />
<config-file target="*-Info.plist" parent="NSCalendarsFullAccessUsageDescription">
  <string>$CALENDARS_FULL_ACCESS_USAGE_DESCRIPTION</string>
</config-file>
zarko-tg commented 7 months ago

Well done @sjregan, this seems to be working. Though in our case I had to change plugin client logic to manual permission request, since it now no longer happens on initiation / function calls (cause now there is more than one kind of permission).

sjregan commented 7 months ago

Well done @sjregan, this seems to be working. Though in our case I had to change plugin client logic to manual permission request, since it now no longer happens on initiation / function calls (cause now there is more than one kind of permission).

Yes, I should have mentioned that and put in a note in the readme.

Ardavan92 commented 7 months ago

For me giving the necessary permissions in config.xml and adding the permissions in deviceready solved the issue for me.

hooliapps commented 7 months ago

I confirm it works with

$CALENDARS_FULL_ACCESS_USAGE_DESCRIPTION

I don't added Write only acces because I don't need it. But it can be a good idea to add it to config.xml

Any plan to update the plugin ?

danielprrazevedo commented 5 months ago

Hey @sjregan Thanks for the great work with this PR. I tested your implementation and I'm not sure about one behavior I found. When I run plugins.calendar.hasReadWritePermissions, if I haven't already run plugins.calendar.requestReadWritePermissions, it opens the permissions request popup. I'm curious about this behavior as I noticed you didn't change this function. I'm using capacitor and testing in a iPhone 15 simulator with iOS 17.2

Pamblam commented 5 months ago

17.1 is out, changed the condition to.. if (@available(iOS 17, *)) { (replaced 17.0 with 17), also this was necessary.

sjregan commented 5 months ago

When I run plugins.calendar.hasReadWritePermissions, if I haven't already run plugins.calendar.requestReadWritePermissions, it opens the permissions request popup. I'm curious about this behavior as I noticed you didn't change this function. I'm using capacitor and testing in a iPhone 15 simulator with iOS 17.2

@danielprrazevedo no idea sorry, that function seemingly just returns a comparison to nil, so it shouldn’t trigger anything

jkenjarCR commented 5 months ago

When will this be pushed to the master branch? Having to replace the code manually really sucks

sjregan commented 5 months ago

@jkenjarCR it’s disappointing when PRs don’t get merged, but you can point your package.json file to a specific commit

jkenjarCR commented 5 months ago

@jkenjarCR it’s disappointing when PRs don’t get merged, but you can point your package.json file to a specific commit

How do you do this?

sjregan commented 5 months ago

@jkenjarCR it’s disappointing when PRs don’t get merged, but you can point your package.json file to a specific commit

How do you do this?

https://duckduckgo.com/?t=h_&q=npm+install+package+specific+commit&ia=web

seanaguinaga commented 4 months ago

I cant figure out the url :(

MrBasque commented 3 months ago

I cant figure out the url :(

The url: git://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/pull/567/commits/1052bec0b75d7438a549cb7a61a5597994695d5a

npm command: npm install --save "git://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/pull/567/commits/1052bec0b75d7438a549cb7a61a5597994695d5a"

ipehimanshu commented 3 months ago

Hello

is there any new version released ?