使用ical4j添加Google calendar日程

iCal4j用于读写iCalendar数据流的一组API。iCalendar标准提供了一种公共的数据格式用于存储关于日历方面的信息比如事件,约定,待办事项等。所有流行日历工具比如:Lotus Notes,Outlook和Apple的iCal都支持iCalendar标准。
  工作需要,用iCal4j建立约会,outlook支持很好。 但发现gmail不能之间添加约会到日程。
多方查证后发现需要如下设置:
ParameterList pls =  new ParameterList();
pls.add(new Cn(mailInfo.getToEmail()));
pls.add(new Rsvp(true));
Attendee attendee = new Attendee(pls,mailInfo.getToEmail());
attendee.setCalAddress(new URI("mailto:"+mailInfo.getToEmail()));
vevent.getProperties().add(attendee);//参会者
设置后约会成功加入到Google calendar

猜你喜欢

转载自coolboy-wangchaobo-163-com.iteye.com/blog/1940488