如何创建“添加到日历” iPhone 网页上的链接
许多日历程序(Outlook、iCal)都支持 vCal,用于下载事件信息并将其添加到日历中。其他人可以使用 vCalendar 微格式来提取数据。然而,iPhone 似乎不支持这两种方法。
是否有任何等效功能可以让我在页面上列出事件信息,并让网站访问者只需单击一下即可将事件添加到她的日历中?由于 Mobile Safari 可以非常轻松地从网页中提取电子邮件和电话号码,因此没有类似的事件功能似乎很奇怪。
Many calendaring programs (Outlook, iCal) support vCal for downloading event information and adding it to your calendar. Others can use the vCalendar microformat to extract data. Neither of these, however, seems to be supported on the iPhone.
Is there any functional equivalent that will allow me to list event information on a page and have a website visitor add the event to her calendar with a single click? Since Mobile Safari makes it super-easy to extract emails and phone numbers from web pages, it seems odd that there's no similar functionality for events.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从 iOS 5 开始,如果您创建指向 .ics 文件的 http 链接,Mobile Safari 将在日历中打开它。
As of iOS 5, if you create a http link to an .ics file, Mobile Safari will offer to open it up in Calendar.
更新:
请注意,这是一个非常古老的答案。从iOS 5开始,您可以使用
EKEventStore
来访问日历活动,Mobile Safari 将在日历中打开.ics
文件。原始答案
这是不可能的,遗憾的是 iPhone 上没有日历 API。您可以构建一个注册 ical URL 方案的应用程序,但您仍然无法将日历条目保存到日历后端,因为没有 API(例如 AddressBook)。
Update:
Note that this is a very old answer. Since iOS 5 you can use
EKEventStore
to access calendar events and Mobile Safari will open.ics
files in Calendar.Original Answer
It's not possible, there is no API for the calendar on the iPhone, sadly. You can build an app that registers for the ical URL scheme, but you still won't be able to save the calendar entries to the calendar backend since there is no API (like e.g. for the AddressBook).
一种解决方案可能是(从 iPhone OS 3.0 开始):
或者使用 Google 日历从您的网站发布条目,这可以轻松完成使用 CalDAV 同步到 iPhone 日历。
另一个有用的链接: http://blog.fosketts .net/2009/06/17/subscribe-internet-calendars-iphone-30/
One resolution could be (from iPhone OS 3.0):
Alternatively use Google Calendar to post entries from your website, which can be easily synched to iPhone Calendar using CalDAV.
Another usefull link: http://blog.fosketts.net/2009/06/17/subscribe-internet-calendars-iphone-30/
在 iPhone 上,虽然没有对 vCal 的内置支持,但您可以使用其他替代方案,例如创建日历链接,用户可以单击该链接将事件直接添加到其日历中。
像 Cal.et 这样的工具可以为各种日历服务(包括 Apple 和 Google 等)生成这些链接。
如果您需要一种简单的方法在您的网站上集成日历功能,那么这是一种实用的方法。该工具简化了这些链接的创建,如果您定期管理日历事件,这会特别有用。
On the iPhone, while there isn't built-in support for vCal, you can use an alternative like creating a calendar link that users can click to add events directly to their calendars.
A tool like Cal.et can generate these links for various calendar services, including Apple and Google and others.
It’s a practical approach if you need a straightforward method to integrate calendar functionality on your website. This tool simplifies creating these links, which can be particularly helpful if you manage calendar events regularly.
您可以创建自己的 ics 文件并将其托管在公共网址上或使用免费/付费服务,例如 https://calex.link 或其他。
You can create your own ics file and host it on a public url or use free/paid services such https://calex.link or others.