luser / calendarview

HTML calendar viewer
Other
27 stars 9 forks source link

unable to load an ICS file form google calendar private link #5

Open ludovicperrier opened 6 years ago

ludovicperrier commented 6 years ago

Hello, i try to use your small code to create simple wall calendar screen view. I want load an ics file serve at this url : https://calendar.google.com/calendar/ical/diotasoft.com_5j6s4tui29e6atghcul1gsqqt8%40group.calendar.google.com/private-211973e9d9a1d4f7652615da0142b384/basic.ics

I have an error in browser console: Failed to load https://calendar.google.com/calendar/ical/diotasoft.com_5j6s4tui29e6atghcul1gsqqt8%40group.calendar.google.com/private-211973e9d9a1d4f7652615da0142b384/basic.ics: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. index.html:1 Uncaught (in promise) Error, HTTP 0

So I put your website on xampp instance and serve it at localhost, I put also the file ics at url http://localhost/basic.ics finally, I create a file .htaccess with this content Header set Access-Control-Allow-Origin "*"

Now I have no error but nothing is diplay on calendar view. Can you help me?

Regards

luser commented 6 years ago

That's unfortunate. If you're trying to fetch a calendar from a different domain you'll definitely need access-control headers for CORS to work. If you look at the network panel in the developer console, do you see it fetching the ics file?

luser commented 6 years ago

If you're just using a Google calendar, you can click "Add Google Calendars" from the settings dialog and it will ask you to grant permissions to your Google account. That's the way I use it locally. I have a full-screen browser loaded on an old Android tablet attached to my refrigerator.