Reputation: 21
This web application designed for mobile devices is written in javascript/backbone with node.js/postgres on the server side. On the client side, I have a function that takes the data from a contact and parses it into a .vcf ready string. From what I understand, client side javascript doesn't grant access to the file system, and I will probably have to do the actual saving in node. I haven't started on that part yet because I'm concerned that the phones won't allow me to do what I want to do.
I would like to have a button that prompts the user if they'd like to add the contact to their device's contacts. Is this even possible from a web app? I'd appreciate it if someone could point me in the right direction.
Upvotes: 2
Views: 6415
Reputation: 23047
There is no way of accessing phone contacts from the web due to huge security problems such functionality can lead to.
Although there is way to access contacts through native applications. You might consider looking into something like PhoneGap that is just a native wrapper around your web application, and it have ability to allow user to share contacts with your application > JS. Then you will be able to modify contacts, add/remove if such permissions are granted to your app.
And check out this documentation from PhoneGap that has some nice functionality that does exactly what you need: http://docs.phonegap.com/en/2.5.0/cordova_contacts_contacts.md.html
For more info, check out this brilliant answer: Get users number from iPhone using HTML5/jQuery
Upvotes: 2