Allowing ics to open in phonegap app for iOS

陌路散爱 提交于 2020-01-11 03:18:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!