Search code examples
ioseventkit

How to determine that an EKCalendar is a Facebook calendar?


Given any EKCalendar, how can I check if this calendar is a Facebook calendar? A Facebook calendar can be the Facebook events calendar or the Facebook birthdays calendar.


Solution

  • Unfortunately, there's no way to tell whether a specific calendar is a facebook calendar without using private API.
    I've filed a bug report during the beta of iOS 6 and an Apple engineer told me they'd fix it for the final release, but it turns out they didn't...

    You can, however, test if a specific event is a facebook event:

    BOOL isFacebookEvent = [[event.URL host] hasSuffix:@"facebook.com"];
    

    This does not work for facebook birthday events, though!