Open yudateNoriyuki opened 4 months ago
I am also facing the same problem with following versions:
Device details iPhone14
OS details iOS17.2.1
@yudateNoriyuki Have you found any solution?
@aks7665 Yes, I was able to solve it using ChatGPT, although not perfectly. I resolved it by modifying the following part of src/ios/Diagnostic_Calendar.m:
[self.eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
[diagnostic logDebug:[NSString stringWithFormat:@"Access request to calendar events: %d", granted]];
[diagnostic sendPluginResultBool:granted:command];
}];
if (@available(iOS 17, *)) {
[self.eventStore requestFullAccessToEventsWithCompletion:^(BOOL granted, NSError *error) {
[diagnostic logDebug:[NSString stringWithFormat:@"Access request to calendar events: %d", granted]];
[diagnostic sendPluginResultBool:granted:command];
}];
} else {
[self.eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
[diagnostic logDebug:[NSString stringWithFormat:@"Access request to calendar events: %d", granted]];
[diagnostic sendPluginResultBool:granted:command];
}];
}
This allows requesting full access to calendar permissions. However, please note that if you're using https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin, this modification alone won't enable you to add events to the calendar. Be cautious about that.
Bug report
CHECKLIST
[x] I have read the issue reporting guidelines
[x] I confirm this is a suspected bug or issue that will affect other users
[x] I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
[x] I have read the documentation thoroughly and it does not help solve my issue.
[x] I have checked that no similar issues (open or closed) already exist.
Current behavior:
Expected behavior:
Before granting calendar permission, the OS dialog should appear, and the response in the successCallback should vary based on the user's selection.
Steps to reproduce:
Same as described above.
Screenshots
Environment information
Cordova CLI version
Cordova platform version
Plugins & versions installed in project (including this plugin)
Dev machine OS and version, e.g.
Runtime issue