remotestorage / modules

DEPRECATED
18 stars 10 forks source link

[contacts] add support for device-native contacts #72

Closed michielbdejong closed 9 years ago

michielbdejong commented 9 years ago

Now available in FxOS and in FF-Android https://developer.mozilla.org/en-US/docs/Web/API/Contacts_API

michielbdejong commented 9 years ago

Same exists for pictures (access the device-native photo storage on the sd-card)

raucao commented 9 years ago

Hmm, this is non-standard (and the SysApps WG won't do it anymore) and available only in packaged apps via the Marketplace, installed locally.

Meaning if we do this, it probably makes much more sense to create a PhoneGap plugin, so at least it works on all the different platforms. No?

raucao commented 9 years ago

BTW, someone proposed creating a Cordova plugin in the past. Not sure if it's documented somewhere.

michielbdejong commented 9 years ago

Right, and it seems that if we implement PhoneGap contacts then we would get FirefoxOS contacts for free (it's listed in the Getting Access section).

I talked to Brian from PhoneGap at JSConfEU once, about how nice it would be to integrate a (remoteStorage) sync-client into PhoneGap, but then it would make more sense to do it the other way around: the device/shell/chrome syncs the contacts with your remoteStorage account, and the app just uses the contacts API without ever including remotestorage.js or even our contacts module directly.

michielbdejong commented 9 years ago

@skddc what does it mean that "sysapps won't do this anymore"? On which platform is that?

raucao commented 9 years ago

It means that the Contacts API spec is dead, because nobody is going to implement the working draft (last one is from 2010).

raucao commented 9 years ago

There's new talk going on in WHATWG about contacts and media access I think.

michielbdejong commented 9 years ago

Right, you mean http://contacts-manager-api.sysapps.org/. I was talking about the support that currently exists in FxOS and FF-Android (and whose interface differs from that sysapps spec). In any case, the third option, PhoneGap. is probably a bigger market right now for this module.

So adding use of the PhoneGap API when available is probably the most useful approach now.

raucao commented 9 years ago

I agree.

Just for the sake of completeness, I meant http://www.w3.org/TR/2010/WD-contacts-api-20100121/ but as you see there are multiple proposals, none of them being picked up by the biggest browser vendors. The one you posted might end up in Tizen or something. ;)

raucao commented 9 years ago

Closing this then, as it has to be done outside of modules, right?

michielbdejong commented 9 years ago

Maybe something needs to live in front of phonegap-contacts and of remotestorage-contacts, to glue the two together somehow.

raucao commented 9 years ago

Thinking about this more: how about a remoteStorage Sync app, which syncs certain remoteStorage data to the device's native data stores? Contacts, calendars, and whatever else is supported I guess.

That way we can actually have support for all the platforms and an easy way to know where the settings are and how it works. Would be super-awesome for syncing contacts etc. anyway. I'd love to add support for GNOME Online Accounts for example.

This might need native code for background sync in the PhoneGap app(s) of course.

michielbdejong commented 9 years ago

Yes, I'm thinking the same thing! :)

First step would be a PhoneGap app that reads all contacts out of your device and your sim card, and saves it to your remoteStorage contacts. I think that on my Android phone my contacts include all my GMail contacts, so that's a great treasure trove. On Firefox OS, I have all my real-world phone numbers in my phone, would love to back those up to remoteStorage (I'm not actually backing those up anywhere at the moment). On PhoneGap-iOS you would probably receive a user's Apple addressbook. It would even allow easily porting contacts between Android and iPhone. So syncing between phonegap-contacts and remotestorage-contacts would be a pretty good showcase app to explain to people how remoteStorage can rock the world. :)

raucao commented 9 years ago

I think the first step would be the remoteStorage connect in that app (including a nicely styled dialog). This can then also be used in any other PhoneGap RS apps.

Edit: dialog should be separate, though. Maybe this is the perfect opportunity for extracting the widget into a separate add-on library.

raucao commented 9 years ago

... as soon as that works, we also have a huge developer base being able to integrate RS sync in native apps.

raucao commented 9 years ago

For reference: http://docs.phonegap.com/en/edge/cordova_contacts_contacts.md.html

Contact access is available on all mobile platforms.