ios - Cordova IOS 7.1 日历是只读的。

标签 ios cordova plugins calendar ios7.1

我们正在使用 cordova 构建跨平台应用程序。 iOS 7.0 及更早版本中可以保存日历。在最新版本中它给出错误。创建日历时找不到日历,如果我们使用 iPhone 日历应用程序手动创建日历,则会出现日历为只读错误。

我们正在使用 EddyVerbruggen 的日历插件。

var startDate = new Date(2014,10,1,18,30,0,0,0);
var endDate = new Date(2014,10,30,19,30,0,0,0);
var title = tempItem.name;
var location = "Home";
var notes = tempItem.description;

var success = function(message) { alert("Success: " + JSON.stringify(message)); };
var error = function(message) { alert("Error: " + message); };

var createCalOptions = window.plugins.calendar.getCreateCalendarOptions();
createCalOptions.calendarName = "Calendar";
createCalOptions.calendarColor = "#FF0000"; // an optional hex color (with the # char), default is null, so the OS picks a color
window.plugins.calendar.createCalendar(createCalOptions,success,error);
window.plugins.calendar.createEventInNamedCalendar(title,location,notes,startDate,endDate,"Calendar",success,error);

最佳答案

我通过在保存事件时不提供日历名称解决了此问题。现在,事件将保存在默认日历中。

关于ios - Cordova IOS 7.1 日历是只读的。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24487634/

相关文章:

ios - 如何像whatsapp一样根据文本长度增加UITextview高度

iphone - 从 SearchBar 查询执行 NSRange 后抛出的异常

javascript - 如何使用cordova在后台调用电话?

ios - Flutter Audioplayers插件不播放声音,而是卡住了该应用程序

php - Push Notification Server 使用什么语言维护与 Apple Push Notification Server 的套接字流连接

android - 如何从 zip 文件安装 cordova 插件

javascript生成方波声音

mysql - MySQL 中 ha_sequence 插件的使用

javascript - 将背景图像添加到 jsPlumb 中的连接器

ios - 在列表和详细信息 ViewController 中重用相同的 View