iOS设备的vCard格式正确吗? [英] Correct vCard format for iOS devices?

查看:130
本文介绍了iOS设备的vCard格式正确吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 5及更高版本中,Apple引入了ABPersonCreatePeopleInSourceWithVCardRepresentation方法,该方法对于将vCard馈送到通讯簿并为创建的人取回ABRecordRefs非常有用.

In iOS 5 and above, Apple introduced the ABPersonCreatePeopleInSourceWithVCardRepresentation method, which is pretty useful in feeding a vCard to the Address Book and getting back the ABRecordRefs for the persons created.

但是,正如我在尝试向通讯簿中添加标准vCard时发现的那样,Apple vCard似乎(至少)与标准vCard不同.某处是否有页面详细说明vCard的Apple格式是什么?

However, the Apple vCard seems to be (at least a bit) different from a standard vCard, as I have found out while trying to add standard vCards to the Address Book. Is there a page somewhere detailing what the Apple-format for a vCard should be?

谢谢!

推荐答案

ABPersonCreatePeopleInSourceWithVCardRepresentation文档指出

The ABPersonCreatePeopleInSourceWithVCardRepresentation docs state that vCard version 3 is the supported protocol. Unfortunately if you're having troubles with a standard vCard I'm not sure how to help - I did a fair bit of searching (that bounty is good motivation :P) and wasn't able to find any further information.

我没有要测试的iPhone,但这个人声称已使用QR扫描仪应用程序(可能使用有问题的API )在iPhone 4上成功导入了以下v2.1 vCard. 3.0规范是2.1规范的超集-您可以尝试使用此vCard并让我知道它是否有效吗?

I don't have my iPhone on me to test, but this guy claims to have successfully imported the following, v2.1 vCard on an iPhone 4 using a QR scanner app (which might be using the API in question). The 3.0 spec is a superset of the 2.1 spec - can you try this vCard and let me know if it works?

BEGIN:VCARD
VERSION:2.1
N:;Company Name
FN:Company Name
ORG:Company Name
TEL;WORK;VOICE;PREF:+16045551212
TEL;WORK;FAX:+16045551213
ADR;WORK;POSTAL;PARCEL;DOM;PREF:;;123 main street;vancouver;bc;v0v0v0;canada
EMAIL;INTERNET;PREF:user@example.com
URL;WORK;PREF:http://www.example.com/
NOTE:http://www.example.com/
CATEGORIES:BUSINESS,WORK
UID:A64440FC-6545-11E0-B7A1-3214E0D72085
REV:20110412165200
END:VCARD

您可以在此处作为最后的解决方案,有那里有很多vCard解析器-这是一种简陋的简单协议.您可以选择其中任何一个(或自己写一个),然后使用ABPersonCreatePeopleInSourceWithVCardRepresentation .

As a last ditch solution, there are plenty of vCard parsers out there - it's a dead simple protocol. You could just take any of these (or write one yourself) and manually add the contact to the Address Book using ABPersonCreatePeopleInSourceWithVCardRepresentation.

这篇关于iOS设备的vCard格式正确吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆