添加日历事件从网络.vcs下载到Android日历、事件、网络、Android

2023-09-12 08:37:50 作者:一梦べ少年蓝

我目前的问题是下面的;我创建了两个文件,​​一个网站下载( .vcs 并的.ics),将增加一个事件一旦点击相应的链接设备日历。对于在iPhone中的.ics我没有问题。我的问题是,下载时在 .vcs 在Android中它只是打开显示的 .vcs 文件内容的空白页,但文件没有下载它既不承认文件作为日历事件。

my current problem is the following; I am creating a website with two files for download(.vcs and .ics) that will add an event to the device calendar once clicked on the respective link. For the .ics in the iPhone I have no problem. My issue is that when downloading the .vcs file in Android it just opens a blank page showing the .vcs file content but is not downloading it neither recognizing the file as a calendar event.

我觉得按照我在此之前阅读(我正在寻找该线程,但找不到它现在的参考),有一些做的 MIME类型,但尝试之后弄清楚如何做到这一点我不能让它工作。

I think as per what I read before in SO (and I was searching for that thread but could not find it now to reference) that has something to do with the mime type but after trying to figure out how to do it I cant make it work.

在该线程同时它们指向一个网站,在 VCS 文件适用于安卓因此是可以做到(我看了很多帖子说,除非你从谷歌下载日历应用程序是不可能的发挥) ; http://plone.org/events/community/plone-conference-2011

In that thread also they point to a site where the vcs file works for Android so is possible to do (I read many posts saying is not possible unless you download a calendar app from google play); http://plone.org/events/community/plone-conference-2011

我检查了网页的源文件code,我想知道是否是他们正在做的服务器端 如果你能请帮我指明了一个方向遵循或工作液或任何建议,你可能对我这将是令人欣慰的。

I inspected that page source code and I am wondering if is something they are doing in the server side If you could please help me pointing out a direction to follow or a working solution or any advice you may have about it I will be thankfully.

PD - 是的,所以我的第一个问题。

PD - Is my first question in SO!

推荐答案

终于得到它的工作添加一个链接到一个位置,与此的index.php

Finally got it working adding a link to a location with this index.php

<?php
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: attachment; filename=london2012.vcs");
?>
BEGIN:VCALENDAR
PRODID:-//AT Content Types//AT Event//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:20120801T133822Z
CREATED:20120801T042948Z
LAST-MODIFIED:20120801T043003Z
SUMMARY:Olympic Games
DTSTART:20120727T000000Z
DTEND:20120812T000000Z
LOCATION:London
URL:http://www.london2012.com/
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

然后从安卓它下载文件,您可以将其导入到日历。 希望是有用别人......

Then from Android it downloads the file and you can import it to the calendar. Hope is usefull for someone else...