11

I'm trying to create a reminder calendar so I can add and delete reminders. It is actually working well on the devices I use (iPhone 5/4S/4) but on certain client devices which are still iPhones - I'm getting this error below about the account not supporting reminders.

Here is the workflow:

* Init the event store.
* Request permission (check its granted for Reminder types) (iOS6+) for lower we just init.
* Create a new calendar, local storage, type = Reminder
* Save calendar to get its Identifier.

Works most of the time, this appears on some devices -

Error Domain=EKErrorDomain Code=24 “That account does not support reminders.” 

Permissions are granted and checked under Settings, Privacy, Reminders. I can't find anything in the docs about the conditions under which you'd get this error.

Thanks!

2
  • 3
    This can happen if the particular calendar comes from a system which doesn't have support for reminders. Try a different calendar, like a local one or one from iCloud. Commented Apr 27, 2013 at 18:13
  • Can you paste your code here?
    – Shmidt
    Commented Apr 28, 2013 at 20:41

4 Answers 4

5

Not sure if you still need this but here is what i ran into.

First of all i'm pretty sure that reminders cannot be set on a calendar with a local source. I kept getting the "That account does not support reminders". Even after setting all non read only properties on the calendar before committing to the event store it still didn't work. The source needs to be calDav. Then I tried Devfly's response and it didn't work either but for a different reason. It kept fetching my gmail calendar which does not allow setting reminders (i think its actually read only for events and reminders). So i used the following code to get the actual iCloud source

    for (EKSource *source in sources) {
        NSLog(@"source %@",source.title);
        if (source.sourceType ==  EKSourceTypeCalDAV && [source.title isEqualToString:@"iCloud"]) {
            localSource = source;
            break;
        }
    }

This setting this source on my new reminders calendar worked for me. hope it helps someone

4
  • FYI i submitted a bug on radar ill let yall know Commented May 21, 2013 at 20:04
  • Apple got back to me some months ago saying that they will fix the issue in a "future release" Commented Jan 25, 2014 at 2:57
  • the title of the iCloud-Account is not always equal to iCloud, it can be changed in the iOS-Settings
    – Felix
    Commented Feb 20, 2014 at 10:57
  • 1
    i think [[source calendarsForEntityType:EKEntityTypeReminder] count] > 0 is a reliable indicator that the account supports reminders
    – Felix
    Commented Feb 21, 2014 at 12:39
2

First, just a check: you are creating a "new calendar" (a whole calendar), not just a "new reminder", right?

Second: are you using iOS6? Reminders are available (in EventKit) only starting from iOS6: link

As commented by Jesse Rusak, this happens because you are probably creating the new calendar inside an account/source that doesn't support reminders. How do you create the new calendar? Do you set the source property?

the first thing you can try, is to loop all sources until you find a suitable one. EKSourceTypeLocal supports reminders. iCal too. Here a list of EKSourceType

typedef enum {
   EKSourceTypeLocal,
   EKSourceTypeExchange,
   EKSourceTypeCalDAV,
   EKSourceTypeMobileMe,
   EKSourceTypeSubscribed,
   EKSourceTypeBirthdays
} EKSourceType;

Find a suitable one:

// find local source for example
EKSource *localSource = nil;
for (EKSource *source in store.sources)
{
    if (source.sourceType == EKSourceTypeLocal)  // or another source type that supports
    {
        localSource = source;
        break;
    }
}

Then, create the new calendar setting the right source

EKCalendar *cal;
if (identifier == nil)
{
    cal = [EKCalendar calendarForEntityType:EKEntityTypeReminder eventStore:store];
    cal.title = @"Demo calendar";
    cal.source = localSource;
    [store saveCalendar:cal commit:YES error:nil];
}

Try and let me know

6
  • Hello, I"m the one who started the bounty (seems original author is inactive). I'm already using the localSource as my calendar source, but it still gives me the same error. I'm testing on iPhone 5.
    – Devfly
    Commented May 2, 2013 at 7:38
  • see my last update, try to create the calendar with the new (ios6 only) calendarForEntityType:eventStore: . It creates a calendar specified for that entity type
    – LombaX
    Commented May 2, 2013 at 8:01
  • Moreover, check your are using iOS6, reminders are not available on EventKit on previous versions. link
    – LombaX
    Commented May 2, 2013 at 8:03
  • @LombaX if he is running on iPhone 5 it is safe to assume he is running iOS 6 Commented May 3, 2013 at 2:41
  • EKSourceTypeLocal doesn't necessarily support reminders.
    – jrc
    Commented Oct 2, 2015 at 15:05
0

What solved my problem is not saving the calendar to the local source, but instead to EKSourceTypeCalDAV (iCloud). It works, and it's synced across all devices.

1
  • I think that my answer guided you in the right way. As you see I've written "loop all source until you find a suitable one". Then I took the local source as example (that should work with my last update). If you think my answer helped please vote (not sure if you can even accept) :-) bye
    – LombaX
    Commented May 3, 2013 at 7:07
0

The local store may not support reminders. This is reproducible if iCloud is enabled.

This is the most reliable solution I could find, without hard-coding any assumptions:

    let calendar = EKCalendar(forEntityType: .Reminder, eventStore: eventStore)

    if eventStore.sources.count == 0 { // reproducible after Reset Content and Settings
        calendar.source = EKSource()
    }
    else {
        calendar.source = eventStore.defaultCalendarForNewReminders().source
    }

    eventStore.saveCalendar(calendar, commit: true)

Not the answer you're looking for? Browse other questions tagged or ask your own question.