问题
i'm working on a mobile site that lists events. I thought that putting together an ICS file, which contains all the information for a specific event, and linking to that file would be enough to have the OS handle the ICS file and add that information to the calendar.
This works on Desktop Computers where the Browser asks if i would like to open the ICS file with a calendar application currently installed.
On android and iOs this does not work at all.
This is what i get on android:
- Chromebrowser - can't download the file; says download failed
- Firefox - downloads the ICS file and opens it with a text editor
- Opera - downloads the ICS file and opens it with a text editor
iOs: downloads the file and does nothing
So, is there a way to serve that info to the user so he/she can add that event to his/hers calendar? (like a JS Framework)
回答1:
I think it all depends on the browser and device setup and/or whether they have the capability. There is no universal way to force an ics file to be added/subscribed to or imported into someone's calendar app.
Desktop browsers by default are set to pass the ics link to whatever they think your calendar application is. (But I For example always open ics files in notepad for testing purposes )
Apparently iphone auto subscribe used to work, but no longer does: http://blog.fosketts.net/2011/01/13/apple-breaks-ics-calendar-autosubscription-ios-42/ People now have to 'subscribe' or import very deliberately.
This may be for good 'privacy' reasons - I can imagine many folks may click on a link without realising that it is going to load events into their calendar.. could be bad.
They only way that I know of that can be done more directly is for google calendar - what I call the "add to google" option. - one just needs to create a link with the right parameters and if people are logged in to gooogle, it will start creating an event with those details - the user still has to 'save' of course.
ONe possibility that may work a little better is to have a link that 'emails' them the isc file. Some email applications expect to deal with ics invites.
https://discussions.apple.com/message/10022359#10022359
http://www.fulltimecasual.com/apple/iphone/accepting-ics-invitations-on-iphone
I'd be interested to know how you go with this. If you find out any more or come up with an alternative plan, please post back here.
"It could get messy:" http://www.zimbra.com/forums/administrators/17564-invites-ics-files-auto-populate-calendar.html
来源:https://stackoverflow.com/questions/7346619/add-event-to-calender-from-within-a-browser-on-mobile-platforms