ICS订阅在Google日历中已损坏

时间:2019-11-01 18:50:46

标签: laravel google-calendar-api icalendar spatie

目标

我需要在Google或Apple日历(或支持.ics的任何功能)中创建一个您可以订阅的日历


问题

预订Google日历中的URL会丢失日历中的大多数事件。这令人困惑,因为它在Apple Calendar中可以完美运行。另外,如果我将浏览器的文字输出另存为.ics文件并导入,那么它在Google和Apple中都可以完美运行。

为什么Google日历仅显示以下事件示例中的“?亡灵节”和“迪士尼+开始流媒体”?


可能有用的东西

控制器

use Spatie\Calendar\Components\Event as iCalEvent;
use Spatie\Calendar\Components\Calendar as iCalendar;

$icalendar = iCalendar::create('AwesomeCalendar');

$icalendar_event = iCalEvent::create()
    ->name($event->name)
    ->description($event->description)
    ->uniqueIdentifier($event->slug)
    ->createdAt($event->created_at)
    ->startsAt($event->started_at)
    ->endsAt(Carbon::parse($event->started_at)->addDays(1))
    ->fullDay($event->is_all_day);

$icalendar->event($icalendar_event);

return response()
    ->streamDownload(function () use ($icalendar) {
        echo $icalendar->get();
    }, 'event.ics');

输出(event.ics)

BEGIN:VCALENDAR
VERSION:2.0
PRODID:spatie/icalendar-generator
NAME:AwesomeCalendar
X-WR-CALNAME:AwesomeCalendar
BEGIN:VEVENT
UID:MKcVjHuP6jJQdCmC565xkyof0xlNJTIMeAcflxsy@awesomecalendar.com
SUMMARY:Blade Runner (Movie Events Take Place)
DESCRIPTION:https://en.wikipedia.org/wiki/Blade_Runner
\n
\nOn November 201
9 Los Angeles\, former police officer Rick Deckard is detained by officer
Gaff and brought to his former supervisor\, Bryant. Deckard\, whose job as
  a \"blade runner\" was to track down bioengineered beings known as replic
ants and \"retire\" (i.e. kill) them\, is informed that four are on Earth
illegally — https://www.awesomecalendar.com/events/MKcVjHuP6jJQdCmC565xkyof0xlN
JTIMeAcflxsy
DTSTART:20191101
DTEND:20191101
DTSTAMP:20171021T210132
END:VEVENT
BEGIN:VEVENT
UID:NUQsBUZnJ1pLJC4oBvTZfFC483AgAHEIcccm2I0S@awesomecalendar.com
SUMMARY:? Day of the Dead
DESCRIPTION:The Day of the Dead is a Mexican holiday celebrated throughout
Mexico\, in particular the Central and South regions\, and by people of Me
xican heritage elsewhere. — https://www.awesomecalendar.com/events/NUQsBUZnJ1pL
JC4oBvTZfFC483AgAHEIcccm2I0S
DTSTART:20191102
DTEND:20191102
DTSTAMP:20190528T084957
END:VEVENT
BEGIN:VEVENT
UID:g4za1xOgYUwYUIddRV6fnu1SAaECYnd4B13hiKoB@awesomecalendar.com
SUMMARY:Disney+ Starts Streaming
DESCRIPTION:https://preview.disneyplus.com/
\n
\nThe ultimate streaming des
tination for Disney\, Pixar\, Marvel\, Star Wars\, and more. — https://w
ww.awesomecalendar.com/events/g4za1xOgYUwYUIddRV6fnu1SAaECYnd4B13hiKoB
DTSTART:20191112
DTEND:20191112
DTSTAMP:20190411T145842
END:VEVENT
BEGIN:VEVENT
UID:diej738in648zPHuKzGCKvATYJJ6LbBMpn9gss13@awesomecalendar.com
SUMMARY:?Deontay Wilder on Joe Rogan Podcast
DESCRIPTION:Excited to hear what the Professional boxer & WBC Heavyweight C
hampion has to say about his recent bout. — https://www.awesomecalendar.com/eve
nts/diej738in648zPHuKzGCKvATYJJ6LbBMpn9gss13
DTSTART:20191210
DTEND:20191210
DTSTAMP:20181206T121310
END:VEVENT
BEGIN:VEVENT
UID:ETmrnUgXouriLcpcI05iqnzfaN0jqrgp9dvX6SJJ@awesomecalendar.com
SUMMARY:Adventures of Lolo\, Ninja Garden\, Wario's Woods come to Nintendo
Switch
DESCRIPTION:Coming to Nintendo Switch Online. — https://www.awesomecalendar.com/
events/ETmrnUgXouriLcpcI05iqnzfaN0jqrgp9dvX6SJJ
DTSTART:20191212
DTEND:20191212
DTSTAMP:20181206T120541
END:VEVENT
BEGIN:VEVENT
UID:2UCViPV27HZyfHSZvF5ruqfRL5ZlZZEXqb5JSoF4@awesomecalendar.com
SUMMARY:?Bill Burr on Joe Rogan Experience
DESCRIPTION:Stand up comic and everyone's favorite angry Bostonian Bill Bur
r stops by the JRE — https://www.awesomecalendar.com/events/2UCViPV27HZyfHSZvF5
ruqfRL5ZlZZEXqb5JSoF4
DTSTART:20191220
DTEND:20191220
DTSTAMP:20181206T121438
END:VEVENT
END:VCALENDAR

0 个答案:

没有答案