创建将 vCard 直接添加到地址簿的链接
我正在构建一个移动网站(适用于 iPhone 和 Android...我认为黑莓已经不适合了),
这就是我遇到的问题。我们希望有一个链接,当单击该链接时,该链接会自动将 .vcf 文件中的联系人添加到移动设备的地址簿中(通过某种方式确认 iPhone/Android 必须已经自行处理)
解决方案 I我尝试过创建一个链接,直接指向 .vcf 文件。它不起作用。我的 iTouch 甚至询问用什么打开该文件...而“联系人”应用程序甚至不在列表中。
我听说,如果这种卡片来自电子邮件,那么它就能完全满足我们的要求……事实是,我们正在这里建立一个网页。
我们使用 HTML5,没有 PhP(还没有,稍后可以针对这个问题添加),并且不涉及 CMS。
I'm in the process of building a mobile site (for Iphones and Androids... I think Blackberry is out of it)
Here the problem I'm with. We want to have a link that, when clicked, automatically adds the contact in the .vcf file to the address book of the mobile device (with some confirmation of some sort that the iPhone/Android must already be handling by itself)
The solution I've tried would be to create a link, directly pointing to the .vcf file. It didn't work. My iTouch was even asking what to open that file with... and the Contact app was not even in the list.
I've heard that a Card of that sort would do exactly what we want if it would come from an email... thing is, we are building up a webpage here.
We use HTML5, no PhP (not yet, could be added later for this problem) and there is no CMS involved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
[更新 - 2013 年 9 月 - iOS7 现在支持从我们的页面直接下载 VCARD 并导入本机联系人应用程序]
使用 VCALENDAR 文件和嵌入式 VCARD 文件的完整解决方案已发布于此处
iPhone:如何让 safari 识别vcard?
其中包含指向我的博客的链接,其中包含有关该主题的完整源代码,位于
http://mobicontact.info/iphone/download-contact-from-web-page/
我希望这有一些帮助......
[UPDATED - Sep 2013 - iOS7 now supports direct download of VCARDs from we page and import into native contact application]
Complete solution using VCALENDAR file with emebedded VCARD file is published here
iPhone: how to get safari to recognize a vcard?
which includes link to my blog with full source code on the subject at
http://mobicontact.info/iphone/download-contact-from-web-page/
I hope this is of some help...
首先,iPhone不支持vCard。无法从网络下载联系人文件。您可以做的是创建一个简单的页面,其中包含电话号码的链接,如下所示:
其次,要让 Android(或其他设备)识别 vCard,您需要将标头设置为正确的 MIME 类型
您应该能够配置您的服务器以将所有 .vcf 文件作为文本/vcard 发送。
Firstly, iPhone doesn't support vCard. There is no way to download a contact file from the web. What you could do is create a simple page which contains links to the phone number, like this:
Secondly, to get an Android (or other device) to recognise the vCard, you need to set the header to the correct MIME type
You should be able to configure your server to send all files of .vcf as text/vcard.