MacGapProject / MacGap1

Desktop WebKit wrapper for HTML/CSS/JS applications.
Other
3.55k stars 208 forks source link

Addressbook support #101

Open rawcreative opened 10 years ago

rawcreative commented 10 years ago

It would be great if the MacGap API had a way to interact with the OSX shared addressbook. This could be a huge benefit for a wide range of apps, and seems to be the only thing really missing from the API.

jeff-h commented 10 years ago

This is a great idea. How extensive would the implementation need to be to be useful? I think implementing the whole API would be a big job. I'm wondering if we could simply supply the user's entire address book as a single object to the JavaScript, and do all searching / filtering etc on the JS side?

Would you also need the ability to add data into the address book?

Finally, can anyone add any insight into how this affects App Sandboxing? If we include code to access an Addressbook, do we then have to check "Contacts" under App Sandbox in Xcode regardless of whether a particular app needs it? I'm not sure that Apple accepts apps that claim the need to use an address book but have no apparent functional reason for requiring it. e.g. if you're creating an HTML5 game for the MAS, we don't want you to have to tick "Contacts" and likely be rejected for it, just because MacGap includes the code.

Either way, it looks increasingly likely that JS coders using MacGap are going to have to dig at least somewhat into the Xcode project in order to configure it to their needs. Not sure how comfortable people are with that?

jeff-h commented 10 years ago

Hmm, contrary to some of my suggestions above, I've just read the following from https://developer.apple.com/library/mac/documentation/userexperience/conceptual/AddressBook/Tasks/Searching.html#//apple_ref/doc/uid/20001024-BABHHIHC:

Letting the framework handle the search can yield significant performance benefits compared to performing the search inside your application, because the framework is aware of the low-level layout of the underlying database, and it can optimize disk access accordingly.

jeff-h commented 10 years ago

It would be great to add Address Book access. I've taken a good look at it and it really wouldn't be that difficult, if it weren't for the issue of serialising the address book data into JSON, which looks surprisingly painful. The ABPerson object is comprised of a whole load of different non-simple object classes.

Anyone care to take a look at this?