hello to all guys
I'm trying to finish my third app (thanks to you and your support , two of my apps are already on appstore :) ), the only part I'm missing is that of adding events to the calendar iOS.
I've already checked the documentation, but it is very rich on this topic ... I also checked if there was any project on github, but nothing even there ... none of the questions about Appcelerator talk about this topic, so I decided to ask you not finding any useful information ...
for now I have this code (add an event to the calendar, the beginning of the event shows an alert, but in the end no and I do not know why) , I extrapolated from the documentation
var defCalendar = Ti.Calendar.defaultCalendar; var date1 = new Date(new Date().getTime() + 3000), date2 = new Date(new Date().getTime() + 180000); Ti.API.info('Date1 : ' + date1 + 'Date2 : ' + date2); var event1 = defCalendar.createEvent({ title : 'Artioli', notes : 'Ricordati di comprare le lenti!', location : 'Ottica Artioli - Milano', begin : date1, end : date2, availability : Ti.Calendar.AVAILABILITY_FREE, allDay : false, }); var alert1 = event1.createAlert({ absoluteDate : new Date(new Date().getTime() - (1000 * 60 * 20)) }); var alert2 = event1.createAlert({ relativeOffset : -(60 * 15) }) var allAlerts = new Array(alert1, alert2); event1.alerts = allAlerts; event1.save(Ti.Calendar.SPAN_THISEVENT);This code is used to repeat the event n times
var newRule = event1.createRecurenceRule({ frequency : Ti.Calendar.RECURRENCEFREQUENCY_MONTHLY, interval : 1, daysOfTheWeek : [{ dayOfWeek : 1, week : 2 }, { dayOfWeek : 2 }], end : { occurrenceCount : 10 } }); event1.recurrenceRules = [newRule];
I wanted to know if we could create an event on the calendar with a single IOS ALERT warning, or at least if we could create a calendar event, and at the end of it I would like the user to be alerted by an ALERT
the code posted above uses a start date and an end date, you can not create an event with a single date is not it?
thanks