问题
So I've used this code from here slightly augmented to work on iOS to create an ics file on the fly.
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:me@google.com\nDTSTAMP:20120315T170000Z\nATTENDEE;CN=My Self ;RSVP=TRUE:MAILTO:me@gmail.com\nORGANIZER;CN=Me:MAILTO::me@gmail.com\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);
});
It works when I view my app straight from safari, however when I view it through phonegap it doesn't work at all. Nothing happens.
Any ideas? Thanks!
回答1:
The calendar plugins here worked perfectly!
https://build.phonegap.com/plugins
来源:https://stackoverflow.com/questions/18166561/allowing-ics-to-open-in-phonegap-app-for-ios