ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef nameArray = ABAddressBookCopyArrayOfAllPeople (addressBook);
m_SourceContactsUserArray = [[NSMutableArray alloc] init];
for (int i = 0; i<CFArrayGetCount(nameArray); i++) {
ABRecordRef person = CFArrayGetValueAtIndex(nameArray, i);
NSString *personName = (NSString*)ABRecordCopyValue(person,kABPersonFirstNameProperty);
[m_SourceContactsUserArray addObject:personName];
}
CFRelease(addressBook);
CFRelease(nameArray);
Do you see your contacts' birthdays on your Calendar app at all? If not, from the Calendar app, tap Calendars at the bottom of the screen, then select Birthdays. Then, from Settings > Calendar > Default Alert Times, check to see what is selected for Birthdays.
Open the Contacts App on your iPhone and tap on the Contact for which you want to setup birthday alerts on iPhone. On the Contact's detail screen, tap on the Edit option located at the top right corner of your screen. Next, scroll down and tap on + Add Birthday option.
Birthdays come from details in your Google Contacts. Tip: If the person is in your Google Contacts, you can edit or remove the person's birthday from the People or Contacts app on your phone, or from google.com/contacts. Settings. Under "More," tap Birthdays.
Try this code:
ABAddressBookRef myAddressBook = ABAddressBookCreate();
NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);
for (id record in allPeople) {
NSMutableDictionary *newRecord = [[NSMutableDictionary alloc] init];
CFTypeRef bDayProperty = ABRecordCopyValue((ABRecordRef)record, kABPersonBirthdayProperty);
if (ABRecordCopyValue((ABRecordRef)record, kABPersonBirthdayProperty))
{
NSDate *date=(NSDate*)bDayProperty;
[newRecord setObject:date forKey:@"birthDate"];
date=nil;
[date release];
}
CFRelease(myAddressBook);
}
it will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With