简体   繁体   English

通过 API 或 URI 协议将 webcal 日历添加到日历应用程序

[英]Adding a webcal calendar to calendar app via API or URI protocol

I am trying to create a calendar export for my sports organization.我正在尝试为我的体育组织创建日历导出。 I get the data from an external API (the match dates change sometimes) and format it to form.ics files.我从外部 API 获取数据(匹配日期有时会更改)并将其格式化为 form.ics 文件。 I got a.ics feed up and running so that is not a problem since I can manually sync it via google calendar and outlook.我启动并运行了 a.ics 提要,所以这不是问题,因为我可以通过谷歌日历和 outlook 手动同步它。

The thing I am trying to find is a way to automatically have it added to the users' calendar via for example the google Calendar API or outlook calendar API or even using the webcal protocol to get a prompt on the users' phone/computer to add it to their calendar app.我试图找到的方法是通过例如谷歌日历 APIoutlook 日历 API或什至使用电话/计算机在协议上添加提示用户/计算机来将其自动添加到用户的日历中它到他们的日历应用程序。 But it also seems like that is not supported on android phones?但 android 手机似乎也不支持这一点?

The api's also don't seem to have this support, both google and outlook only provide a way to add a calender by supplying a name for it in the request body. api 似乎也没有这种支持,google 和 outlook 都只提供了一种通过在请求正文中为其提供名称来添加日历的方法。 ref: google , outlook参考: 谷歌outlook

I hope someone can get me through this or provide another alternative.我希望有人能帮我解决这个问题或提供另一种选择。 Thanks in advance!提前致谢!

EDIT: I found in this post that I can directly link users to the webcal link and this works, but it opens a browser the google calendar instead of the app, is there a workaround for this?编辑:我在这篇文章中发现我可以直接将用户链接到 webcal 链接,这可以工作,但它会打开浏览器谷歌日历而不是应用程序,是否有解决方法?

I think the best approach would be to manually import the ics file into the Google Calendar of a specific Google account and then use the API with the events: list method to list all the events created by that file and retrieve their eventId parameter, then use it along with the calendarId parameter to update each event and automatically invite the users to all the events.我认为最好的方法是手动将 ics 文件导入特定 Google 帐户的 Google 日历,然后将 API 与events: list方法列出该文件创建的所有事件并检索其eventId参数,然后使用它与calendarId参数一起更新每个事件并自动邀请用户参加所有事件。

Since you mentioned that the dates of the events can change sometimes, with this method you will make sure that all the invited users get notifications whenever there is an update so they don't miss any changes.由于您提到事件的日期有时可能会更改,因此使用此方法您将确保所有受邀用户在有更新时收到通知,这样他们就不会错过任何更改。

References:参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM