How do you add a link that will add an event to yo

2019-03-23 09:49发布

问题:

This seems like it should be simple but after a couple hours of googling I have not figured it out. I know I can add iCal links using ICS files, but this does not work on the iPhone.

BTW, when I say iPhone I would like it to work on the touch also. Anyone have any luck with this?

回答1:

You can get iPhone to download the .ics file (using Safari on a mobile web page) by using the webcal protocol:

webcal://website.mobi/mymeeting.ics



回答2:

As of iOS 5, if you create a simple http link to an .ics file, Mobile Safari will offer to open it up in Calendar.



回答3:

According to the iPhone documentation there is no URL scheme for the Calendar application. (There are URL schemes for Mail, Phone, Map, YouTube and iTunes.)

Of course there could be something undocumented, but I'm not sure that using it would be a good idea even if you can find it.



回答4:

http://developer.apple.com/DOCUMENTATION/AppleApplications/Reference/SafariWebContent/UsingiPhoneApplications/chapter_6_section_1.html#//apple_ref/doc/uid/TP40006513-SW1

I just found this which contains Mail, Phone, Map and YouTube. Maybe this means it isn't possible.



回答5:

Of course it is possible but only if your JavaScript application is installed on the device. Look at http://tetontech.wordpress.com to see how to make calls from JavaScript to Objective-C. You can then use this and the Calendar Store Programming Guide from the documentation in Xcode to do what you want.



回答6:

It is not possible. Apple does not want you to do this.

Now, what you could do is bookmark a javascript bookmarklet that checks the user-agent of the browser invoking it, and if the user is on Safari on their laptop or desktop Mac, then invoke the iCal using standard method (ICS file).

The user on iPhone could bookmark your page into a home screen bookmark with a useful (and perhaps custom) icon that said "Event" and title of "Meet Mary at 8:15". They could then, when they have synced their bookmarks, be reminded of the event and invoke it on their desktop browser.

Significant barriers here to educating users how to use this system, but it would work if you could convince people to do it, I think.