Reputation: 957
I'm new in iPhone development. I want to add facebook's friends name into iPhone's address book.
I can get get facebook's friend list from the facebook using facebook's sdk.framework
.
Can someone help me to insert this friends name into iPhone address book?
Upvotes: 0
Views: 226
Reputation: 12787
You need to read Adress book programing from here
And for inserting contact: idea is -
You need make object of address book ABAddressBookRef addressBook = ABAddressBookCreate();
then create a record like this ABRecordRef person = ABPersonCreate();
then set some property like this
ABRecordSetValue(person, kABPersonFirstNameProperty, CFSTR(fbUserName), &anError);
fbUserName is the name of your friend getting by fbGraph api.
then you need to insert this record in address book ABAddressBookAddRecord();
then save the changes. ABAddressBookSave();
at last
CFRelease(addressBook);
Upvotes: 0