Calendar-PhoneGap-Plugin
Calendar-PhoneGap-Plugin copied to clipboard
"deleteCalendar" will trigger nothing when there is no exist "calendarName"
hi @EddyVerbruggen I am using PGB 5.2.0 with your latest version from npm https://www.npmjs.com/package/cordova-plugin-calendar
this is my full example
var calendarName = "mycalendar";
window.plugins.calendar.deleteCalendar(calendarName, success, error);
well... in iOS 8.4.1 (12H321),if I use "deleteCalendar" when there is already a exist "calendarName ",it will trigger the success callback but... when there is no exist "calendarName",it will trigger "nothing" (it it should be trigger the error callback ?)
The error callback is for unexpected runtime trouble IMO, or in case your input is incorrect.
I will change it so that the successcallback returns true in case a calendar was found (and deleted) and false if there was no such calendar.
WDYT?
hi @EddyVerbruggen I think...perfect!!! don't be angry,I am just suggestion XD
Hey man, I'm not angry at all, this is a very reasonable question and I think that the current implementation could be better :+1: :+1:
OKOK thanks @EddyVerbruggen again
Is this still in the latest version? I am using ionic 3 and if I do this
await this.calendar.deleteCalendar('xxx')
It seems it never return
@hkjeffchan This API doesn't return promises; it calls the success and error functions you supply at the end of the parameters list.