所以我使用了这段代码here稍微增强一下,可以在 iOS 上动态创建 ics 文件。
msgData1 = $('.start-time').text();
msgData2 = $('.end-time').text();
msgData3 = $('.Location').text();
var icsMSG = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Our Company//NONSGML v1.0//EN\nBEGIN:VEVENT\nUID:[email protected]\nDTSTAMP:20120315T170000Z\nATTENDEE;CN=My Self ;RSVP=TRUE:MAILTO:[email protected]\nORGANIZER;CN=Me:MAILTO::[email protected]\nDTSTART:" + msgData1 +"\nDTEND:" + msgData2 +"\nLOCATION:" + msgData3 + "\nSUMMARY:Our Meeting Office\nEND:VEVENT\nEND:VCALENDAR";
$('.test').click(function(){
var icslink = "data:text/calendar;charset=utf8," + escape(icsMSG);
$(this).attr("href", icslink);
});
当我直接从 safari 查看我的应用程序时它可以工作,但是当我通过phonegap 查看它时它根本不起作用。什么都没发生。
有任何想法吗?谢谢!
这里的日历插件运行得非常好!
https://build.phonegap.com/plugins
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)