react-native-calendar-events: iOS 17 issues: unable to request permissions

I am running iOS 17 beta with XCode 15 beta and i’m getting issues when requesting permissions using this library. Works fine with iOS 16. Seems as if Apple have changed the Calendar permissions API on iOS 17: https://developer.apple.com/documentation/eventkit/accessing_calendar_using_eventkit_and_eventkitui#4250785

Environment

react: 17.0.2 react-native: 0.67.2 react-native-calendar-events: 2.2.0

Steps to Reproduce

Added the following to Info.plist

  <key>NSCalendarsUsageDescription</key>
  <string>This app requires access to the calendar</string>
  <key>NSCalendarsFullAccessUsageDescription</key>
  <string>This app requires access to the calendar</string>

(I’ve tried using just either one but same result)

import RNCalendarEvents from "react-native-calendar-events";

Requesting permissions:

 RNCalendarEvents.requestPermissions((readOnly = false)).then(response => {
            console.log(response);
 });

Checking permissions:

RNCalendarEvents.checkPermissions(false).then(async (response) => {
            console.log(response);
});

Actual Behavior

Requesting permissions response:

Error: authorization request error

Checking permissions response:

undetermined

About this issue

  • Original URL
  • State: open
  • Created 10 months ago
  • Reactions: 2
  • Comments: 16

Commits related to this issue

Most upvoted comments

if the library is not updated until new iOS is released (probably 12th Sept) you can use this commit that fixes calendar and gives full permission on request: https://github.com/andrejguran/react-native-calendar-events/commit/f8765674d966a623dc99ccab2e263171ff61155e

if the library is not updated until new iOS is released (probably 12th Sept) you can use this commit that fixes calendar and gives full permission on request: andrejguran@f876567

how can I use this?

You should be able to use it like this in your package.json

"react-native-calendar-events": "git://github.com/andrejguran/react-native-calendar-events.git#f8765674d966a623dc99ccab2e263171ff61155e",