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

[expo-calendar] [iOS] Fix unnecessary permission check for calendars when calling saveCalendarAsync with entityType "reminder" #24967

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-calendar/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### 🐛 Bug fixes

- [iOS] Fix unnecessary permission check for calendars when calling `saveCalendarAsync` with `entityType` `"reminder"` ([#24967](https://github.com/expo/expo/pull/24967) by [@robertying](https://github.com/robertying))

### 💡 Others

## 12.1.0 — 2023-10-17
Expand Down
7 changes: 5 additions & 2 deletions packages/expo-calendar/ios/EXCalendar/EXCalendar.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,18 @@ - (EKEventStore *)eventStore
resolver:(EXPromiseResolveBlock)resolve
rejecter:(EXPromiseRejectBlock)reject)
{
if (![self _checkCalendarPermissions:reject]) {
NSString *type = details[@"entityType"];
if ([type isEqualToString:@"event"] && ![self _checkCalendarPermissions:reject]) {
return;
}
if ([type isEqualToString:@"reminder"] && ![self _checkRemindersPermissions:reject]) {
return;
}

EKCalendar *calendar = nil;
NSString *title = details[@"title"];
NSNumber *color = details[@"color"];
NSString *sourceId = details[@"sourceId"];
NSString *type = details[@"entityType"];
NSString *calendarId = details[@"id"];

if (calendarId) {
Expand Down
Loading