Hi,
I'm struggling with an odd problem. I have an app that searches the user's calendars for current events. The code works correctly on an iPhone, and in the Watch simulator but not on a real watch. I've narrowed it down to the observation that for some reason the calendars that the app has access to are different on the watch and on the phone. Both the watch and the phone are signed into the same iCloud account and I can confirm that the actual calendar app on the watch can see all of the calendars. This snippet simply prints out the calendars that the code has access to: (Note that this is after I have successfully requested and received access from the user)
let cals = store.calendars(for: EKEntityType.event)
NSLog("We can access \(cals.count) calendars")
for cal in cals {
NSLog(" \(cal.title)")
}
When this is run on the phone:
fastdial[1766:775660] We can access 22 calendars
(followed by the list of 22 calendars)
When this is run on the watch:
2017-04-10 10:18:30.726047-0700 FastDialWatch Extension[268:313870] We can access 2 calendars
2017-04-10 10:18:30.738466-0700 FastDialWatch Extension[268:313870] US Holidays
2017-04-10 10:18:30.739022-0700 FastDialWatch Extension[268:313870] Birthdays
Again, to be clear the calendar on the watch can see all of the calendars and so can the complication. The code in question is in the same file and in the same project.
iOS 10.3.1 on an iPhone SE
watchOS 3.2 on a Series 2
Xcode 8.3.1
Any ideas how I can go about debugging this?
Thanks.