iOS contacts and facebook/twitter IDs

63 views
Skip to first unread message

Sarah George

unread,
May 16, 2013, 11:06:26 PM5/16/13
to phon...@googlegroups.com
iOS allows contacts to be linked to Facebook & Twitter. In the Contacts app, for a given contact I can see their facebook & twitter IDs.

But if I find for the contact in PhoneGap, the information isn't there, not even in the "ims" list.

Is there something I'm missing? Is there an existing plugin/workaround? Has anyone else encountered this problem?

Thanks!



Sarah George

unread,
May 17, 2013, 12:01:21 AM5/17/13
to phon...@googlegroups.com
It looks like the record I want from iOS might be called "kABPersonSocialProfileServiceTwitter". I can't find it in the source code; so perhaps its just not supported yet?

jcesarmobile

unread,
May 17, 2013, 2:37:30 AM5/17/13
to phon...@googlegroups.com
You'll need a plugin for that, I don't think phonegap is going to include it in the future, as it is iOS only.

Sarah George

unread,
May 17, 2013, 4:21:47 AM5/17/13
to phon...@googlegroups.com
Thanks, that makes sense. Do you know if such a plugin already exists somewhere?

jcesarmobile

unread,
May 17, 2013, 4:38:51 AM5/17/13
to phon...@googlegroups.com
I have not seen it on the oficial plugin repositories.

Sarah George

unread,
May 17, 2013, 4:51:59 AM5/17/13
to phon...@googlegroups.com

Yeah the nearest I can find is the iOS social plugin, which is aimed more at share-sheets than getting account info from contacts. It might be time for me to crack open that plugin developer's guide... wish me luck :) 

Thanks for your feedback!

jcesarmobile

unread,
May 17, 2013, 6:17:11 AM5/17/13
to phon...@googlegroups.com
maybe if you fill a feature request somebody can add it to future versions, it shouldn't be difficult to add this to the ims array

Giacomo Balli

unread,
May 17, 2013, 1:54:01 PM5/17/13
to phon...@googlegroups.com
rather than a plugin, I think you're better off editing the original CDVContact.m and just add the social media fields to the elements retreivied from the address book entry.

Sarah George

unread,
May 20, 2013, 2:13:25 AM5/20/13
to phon...@googlegroups.com

It's kind of a tricky decision; I could add it to the IMs list pretty easily but then I couldn't split out the source of "ims" records easily when saving records. 

I'm leaning towards writing a small plugin so the code is separate & re-usable.

Sarah George

unread,
May 24, 2013, 3:56:57 AM5/24/13
to phon...@googlegroups.com
ok; I have this starting to work (needs a bit of cleanup but what doesn't?) 

I ended up NOT making it a plugin because there's all kinds of complications with threading and non-thread-transferable address book objects (and needing a UI thread to ask for permission to access it) that phonegap handles and I didn't want to duplicate.

So I've added a nonstandard field, "ios_socialProfiles". My plan is to make it NOT a default field so "*" won't include it, but if you request it by name it'll bring back the data for you. Seems the best I can do to add an iOS specific field in a reasonable time.

I'll post a patch once I've got it "good enough for my own purposes", not sure if it'll be accepted into phonegap proper but who knows it might be useful to someone :) 




Reply all
Reply to author
Forward
0 new messages