2

这个为移动设备设计的 Web 应用程序是用 javascript/backbone 编写的,服务器端有 node.js/postgres。在客户端,我有一个从联系人获取数据并将其解析为 .vcf 就绪字符串的函数。据我了解,客户端 javascript 不授予对文件系统的访问权限,我可能必须在 node.js 中进行实际保存。我还没有开始这部分,因为我担心手机不允许我做我想做的事。

我想要一个按钮来提示用户是否要将联系人添加到他们设备的联系人中。这甚至可以通过网络应用程序实现吗?如果有人能指出我正确的方向,我将不胜感激。

4

1 回答 1

2

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

于 2013-07-08T14:25:22.297 回答