简体   繁体   English

URL 方案,用于打开具有特定事件 ID 的本地日历

[英]URL scheme for opening native calendar with specific event id

At first, I knew there is no public APIs for this approach.起初,我知道这种方法没有公共 API。


Tapping an event from iOS8 native calendar widget launches calendar with specific event.从 iOS8 本地日历小部件中点击一个事件会启动带有特定事件的日历。 So, I can guess that there must be a URL scheme for it.所以,我猜想它一定有一个URL方案。 Because widget and calendar works on each sand box, So, the NSURL must be used.因为小部件和日历适用于每个沙盒,所以必须使用NSURL


I found a some clues from iPhoneDevWiki.net .我从iPhoneDevWiki.net找到了一些线索。 It says that calshow:x?eventid=id is an URL scheme that opens specific event, and it is used by SpringBoard .它说calshow:x?eventid=id是一个打开特定事件的 URL 方案,它由SpringBoard使用。

Since the value of the id param is not described clear, So, I have tested this url scheme with:由于id参数的值没有描述清楚,所以,我测试了这个 url 方案:

  • EKEvent.calendarItemIdentifier
  • EKEvent.externalCalendarItemIdentifier
  • EKEvent.eventIdentifier

None of them did work.他们都没有工作。

The wiki may be outdated. wiki 可能已过时。

Is there anyone who could opens or reveal the specific event with native calendar?有没有人可以使用本地日历打开或显示特定事件?


And I found another clue from similar questions in Stack Overflow .我从Stack Overflow 中的类似问题中找到了另一条线索。

The calshow: scheme. calshow:计划。

It seems to used for open calendar with specific date.它似乎用于具有特定日期的打开日历。 It can be used as calshow:[time interval since reference date] , the reference date seems to 1/1/2001它可以用作calshow:[time interval since reference date] ,参考日期似乎是 1/1/2001

It can be used to reveal an event rather than opens it.它可用于显示事件而不是打开它。 However, when the calendar is not running on background, This approach also not works.但是,当日历不在后台运行时,这种方法也不起作用。


And I also found that the x-apple-calevent scheme can launches calendar also, But I don't know the details(path and params) at all.而且我还发现x-apple-calevent方案也可以启动日历,但我根本不知道细节(路径和参数)。


Any clues and opinions will be welcomed.任何线索和意见都将受到欢迎。

Best Regars.最好的问候。

I've been able to use the calshow:x?eventid=id scheme by我已经能够使用calshow:x?eventid=id方案了

  • provide a timestamp (seconds) since reference date (Jan 2001) for xx提供自参考日期(2001 年 1 月)以来的时间戳(秒)
  • provide a numeric value for eventideventid提供一个数值

I've been able to open event details on a simulator using these arguments calshow:685409700?eventid=99 .我已经能够使用这些 arguments calshow:685409700?eventid=99在模拟器上打开事件详细信息。

iPhone 模拟器显示系统日历 - 事件视图

As you can see date information is inferred from the timestamp and in this case is incorrectly showing that Thanksgiving is on Sep 21st如您所见,日期信息是从timestamp推断的,在这种情况下错误地显示感恩节是在 9 月 21 日

Lower eventid like 1 , 2 , up to at least 20 open contact related information, for example using calshow:685409700?eventid=1 brings this up较低的eventid1 , 2 ,最多至少20打开的联系人相关信息,例如使用calshow:685409700?eventid=1会显示此信息

显示联系信息的 iPhone 模拟器


Using non numeric IDs or numbers higher than 200 doesn't seem to work and they just open the Day View for the specific timestamp使用非数字 ID 或高于 200 的数字似乎不起作用,它们只是打开特定时间戳的日视图

The eventid parameter seems to use some numeric indexing and not actual event/calendar item identifiers eventid参数似乎使用了一些数字索引而不是实际的事件/日历项目标识符

I've accidentally managed to make the url scheme match something, because the id I tried to use started with 16 , so I guess it was parsed to the number 16我不小心设法使 url 方案匹配某些东西,因为我尝试使用的id16开头,所以我猜它被解析为数字16

I've also been able to match some of the events created from my app by using eventid between 100 and 150通过使用介于100150之间的eventid ,我还能够匹配从我的应用程序创建的一些事件

Other than that I have no clue about what id the eventid is being mapped to除此之外,我不知道eventid被映射到什么id

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

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