Calendar plugin


#1

Is anybody using the calendar plugin successfully?
We have the problem that creating more than 1 event on iOS does not work. Android is OK.
e.g.
both createEvent work fine on their own. Two in a row just does nothing. No error, no catch, no calendar-entry.

Calendar.createEvent("Event 1", "Location", "notes", new Date(2017, 1, 1, 13), new Date(2017, 1, 1, 14))
  .then(result => {
    console.log("1 create event success: ", result);
  })
  .catch(error => {
    console.log("1 create event error: ", error)
  })

Calendar.createEvent("Event 2", "Location", "notes", new Date(2017, 1, 1, 15), new Date(2017, 1, 1, 16))
  .then(result => {
    console.log("2 create event success: ", result);
  })
  .catch(error => {
    console.log("2 create event error: ", error)
  })

#2

Which calendar plugin are you using?


#3

The one which is integrated with ionic-native:
Repo: https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin

In the meantime I tested chaining the createEvents-Promises, such as
Calendar.createEvent(“Event1”…).then(() => {Calendar.createEvent(“Event2”…)})

and this works. So I guess, the createEvent-Code is not re-entrant. The second call overwrites the first call in progress.
But it is hard to believe that I am the first person creating more than one event at once.
Thanks for any help.


#4

Seems to be an known issue. The method is not thread-safe.
Details and my solution:


#6

Hi there. Can you please share how you can dynamically just the calendar dates via Firebase JSON? Thanks!