Open ide opened 8 years ago
@ide How exactly did you get this working? Using your example code I simply receive an empty array.
IIRC the example code only reproduces the issue but it was from over a year ago.
So you didn't manage to use this library to retrieve your contacts?
From my original post it sounds like you could fork this library and get it working for this specific use case if that’s important. But I don’t think I used this library for my own project.
Thanks.
Tested with removing the filter and it still returns an empty list of addressBooks, so seems that it fails somewhere else too.
This works for me with iCloud `addressBooks = responses.filter(function (res) {
//return typeof res.props.displayname === 'string';
return res.props.resourcetype.includes('addressbook');
}`
I looked into using
dav
to interact with my iCloud contacts so that I could programmatically add contacts to my phone. One of the first things I ran into was thatdav
returns an empty list of address books because it filters out all address books missing adisplayname
field. When I remove that filter call, I get back all of my iCloud contacts.I'm not familiar with DAV and don't know the right fix right now but maybe someone who has experience with DAV knows how to address this.
Code: