Comments (4)
Most likely, there is a missing reloadData
call here: https://github.com/richardtop/CalendarApp/blob/master/Calendar/CalendarViewController.swift#L28
Also, you might need to re-subscribe to the EventStore updates, i.e. invoke this method again:
https://github.com/richardtop/CalendarApp/blob/master/Calendar/CalendarViewController.swift#L32
Let me know, if any of these suggestions improve the situation and feel free to submit a pull request.
I don't think the CK version matters here, since it's clearly an error in the CalendarApp.
from calendarapp.
thanks, i tried the following, using the package SPPermissions:
override func viewDidLoad() {
super.viewDidLoad()
title = "Calendar"
navigationController?.view.backgroundColor = .systemGray6
if !SPPermissions.Permission.calendar.authorized {
requestAccessToCalendar()
} else {
subscribeToNotifications()
}
}
my requestAccessToCalendar()
function looks like this:
func requestAccessToCalendar() {
let permissions: [SPPermissions.Permission] = [.calendar]
let controller = SPPermissions.dialog(permissions)
controller.delegate = self
controller.present(on: splitViewController ?? self)
}
and i implement the callback function like this:
extension CalendarController: SPPermissionsDelegate {
func didAllowPermission(_ permission: SPPermissions.Permission) {
reloadData()
subscribeToNotifications()
}
}
When i run my app, everthing works without crashing, but i get the following messages in console:
[EventKit] Error (1013) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 1/3
[EventKit] Error (1013) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 2/3
[EventKit] Error (1013) in reply block for CADDatabaseFetchCalendarItemsWithPredicate attempt 3/3
[EventKit] All retries exhausted for CADDatabaseFetchCalendarItemsWithPredicate
from calendarapp.
it's a bug. After Permission is granted, you need to create an new EKEventStore()
like this:
extension CalendarController: SPPermissionsDelegate {
func didAllowPermission(_ permission: SPPermissions.Permission) {
eventStore = EKEventStore() // --> create a new Instance
reloadData()
subscribeToNotifications()
}
}
from calendarapp.
Keeping this open, until I fix this. But if you'd like, I'd appreciate the pull request fixing this issue. Thanks for the investigation!
from calendarapp.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calendarapp.