03-10-2020 19:50
03-10-2020 19:50
I'm adding calendar support to my watch, and noticed something odd today. There was an event that had "Holi" as the title. Digging in, it came from calendar "US Holidays" that comes from "Subscribed Calendars" source. I don't know where "Subscribed Calendars" is coming from... is there any way to figure that out? There is another source named "Other" that I am not sure about either.
Is there a way to surface the available sources/calendars to the user (through settings or something) and let them pick which ones show up in the watch/app?
Thanks
Answered! Go to the Best Answer.
03-11-2020 14:19
03-11-2020 14:19
Yeah, the Agenda app does this:
Get a list of all calendar sources
Save those to settingsStorage
Let the user select specific calendar IDs and save those to settingsStorage
Filter events by the selected calendars.
calendars
.searchSources()
.then((sources) => {
console.log(`permission -> ${me.permissions.granted('access_calendar')}`);
console.log("received sources")
sources.forEach((source) => {
console.log(`Source with title: ${source.title} and id: ${source.id}`)
})
})
03-11-2020 14:19
03-11-2020 14:19
Yeah, the Agenda app does this:
Get a list of all calendar sources
Save those to settingsStorage
Let the user select specific calendar IDs and save those to settingsStorage
Filter events by the selected calendars.
calendars
.searchSources()
.then((sources) => {
console.log(`permission -> ${me.permissions.granted('access_calendar')}`);
console.log("received sources")
sources.forEach((source) => {
console.log(`Source with title: ${source.title} and id: ${source.id}`)
})
})
03-11-2020 14:24
03-11-2020 14:24
Nice idea, thanks!
07-27-2022 00:33
07-27-2022 00:33
Hello Jon,
How we can display dynamicaly all sources on the settings page please?
Best regards,
Mike