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.
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?
Thanks!
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.
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
You can read the official 3.0 spec here and here.
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.
I've created a backwards compatible VCard class, that generates .vcf files. But for iOS devices < iOS 8, the class exports to .ics files (VCards are then wrapped in a VCalendar file) because thats the only way to get things working on older iOS versions!
Used by thousands of people! Check it out on GitHub
Since iOS 9 / iPadOS 9 / watchOS 2.0 / macOS 10.11 you should use the Contacts framework instead with the formatter class CNContactVCardSerialization documented at
https://developer.apple.com/documentation/contacts/cncontactsuserdefaults
Unfortunately, i no longer see a mention of the vCard version(s) that are supported.
Related
Back in the day, one of the Quirks of the Macintosh OS was that files had two "forks", a "resource fork" which held resources used by software through dedicated resource APIs, and a "data fork", which held the plain old data like on other systems, including binary code, text in plain text files, etc.
A little-known feature of HFS+, introduced with Mac OS 8.1 in 1998, is that you can have any number of named forks of any file. Similar to the also little-known feature of NTFS called "ADS" (Alternate Data Streams).
From Wikipedia:
HFS Plus permits filenames up to 255 characters in length, and
n-forked files similar to NTFS, though until 2005 almost no system
software took advantage of forks other than the data fork and resource
fork
Apple doesn't seem to document the APIs for making use of those extra forks any longer.
Do we know if and when Apple officially deprecated the feature? If not, do we know when the APIs vanished from the documentation.
Back in the day, one of the Quirks of the Macintosh OS was that files had two "forks",
Quirk? Rather a well known feature.
Similar to the also little-known feature of NTFS called "ADS" (Alternate Data Streams).
It was a great way to organize Data.
Apple doesn't seem to document the APIs for making use of those extra forks any longer.
They are well documented in according Manuals - even online like here. Ofc, there is no reason to go into them since they are deprecated since 10.9 (Mavericks)
Do we know if and when Apple officially deprecated the feature?
Yes, they did, and the moment in time was October 2013 when OSX 10.9 was released.
If not, do we know when the APIs vanished from the documentation.
Still there today ... at least when looking in the appropriate API documentation for any Mac OS between 1999 (MacOS 8) and 2013.
Always look at the API for the Version used. Actual OSX does no longer encurrage its use, so not to be found there.
I need to create an application capable to modify and manage files on IOS.
With IOS 5 is "easy" to create a Document-Based Application, but I need to support IOS 4 too.
Anyone knows if there is a way to create a Document-Based Applications in IOS 4?
Thanks in advance.
Short answer is no as UIDocument and UIManagedDocument only arrived with iOS 5
Long answer is yes. There are hundreds of document based apps for iOS. e.g Brushes, Sketchbook Pro which are all document based apps. My own app is document based, its not that hard to do.
What UIDocument/UIManagedDocument provides is a canned API for making a generic document. Feed it a URL and it does (most of) the rest of the housekeeping.
If you wish to do an iOS4 based app then stuff you will need to pay attention to is.
UIApplicationWillTerminateNotification/UIApplicationDidEnterBackgroundNotification
Opening a new document.
Saving a document.
Shutting a document.
Autosave (maybe)
Core Data stack , if you're using Core Data
www.raywenderlich.com has some great tutorials. Maybe even iOS4 based ones still.
IMO - Don't bother with iOS4 support. Like above post states 85% use iOS5 and anyone still on iOS4 probably isn't in your target market. Especially as this is (I assume) a new app and iOS6 will be around by the time you go to market.
Just going to ask, do you really need to support iOS 4?
The adoption of iOS is over 85% of devices.
Whats the basis for the need to continue iOS 4 support?
I create VCards (.vcf-files) in some apps of mine. Now a customer needs to add a private mobile and a business mobile number to a vcard.
I have tried to add two times the same attribute to the vcard (TEL;CELL;VOICE) but this seems not to be supported (at least outlook only takes the first instance).
Is there a up-to-date description of all fields I can add into vcards and is there a description on what is allowed and what are donts.
If I search the web, I find a lot of information, but the most of it is very old and it seems that the different clients only support a subset of attributes.
Check the version of vCard that Outlook supports vs. the version to which you are coding.
I think that Outlook supports only vCard ver 2.x and perhaps that version does not support what you are trying to do.
Maybe the cardme project will do your happiness.
Many others projects are existing, but these one was the best to my point of view.
When you read the Class Reference of every object of iOS, you will find:
Available in iOS 2.0 and later.
There are a program or a way to list all function and the minimum iOS system?
How can I know if the iPhone with iOS 3.0 will run all iOS function? I can check it in runtime with respondToSelector, but can be more easy with source code?
Set your project's base SDK to iOS 3, and see if it builds.
AFAIK there is no way to list all the APIs you use in your app into one list and check that you are building past the minimum for all those APIs. You will just have to check each one, one by one. Highlight the API in Xcode, and then click escape and it will tell you very easily.
But also I have to mention that this won't be extremely necessary since you should test on the minimum OS you are building for and if it crashes at any point then you have your issue for that certain API.
Is there currently any API (public or private) that will allow a 3rd party Mac OS X application to stream audio to AirPlay receivers? Airfoil by Rogue Amoeba Software seems to be able to do this, same goes for Erica Sadun's AirFlick, but I was unable to find any source code that would demonstrate how to do this. Any pointers are appreciated!
Here is an open source ruby implementation. It's pretty straight forward. https://github.com/elcuervo/airplay
It turns out AirPlay audio streaming is possible as of OS X 10.8 using public APIs, but wasn't really documented anywhere. Joris Kluivers wrote a great blog post on how to get it going.
There are a couple of open-source RAOP players available; I haven't tried them, so I don't know if Apple has broken them since they were written.
Mountain Lion (OS X 10.8) has added AirPlay support in the sound settings. The user can choose to send the local sound output to an AirPlay device. However, I don't think that you have access to any API within your app.
There are some libraries available to implement AirPlay, but know that Apple will reject your app if you try to publish it on the App Store. At least, that's what happened to me.
I wrote a node.js module to support AirPlay. Even if you don't use node, you can just pipe your audio data through stdin.
https://github.com/lperrin/node_airtunes/
I don't think it's available. At least not in versions prior to 10.7.
I'm guessing that Airfoil uses something like DVD John did a while ago when he cracked the Airport Express key payload. He released the code (C#) you should be able to find it but it's pretty cryptic.
I'm not aware of what AirFlick uses but you could always try pinging Erica, she usually shares her stuff.
Someone recently managed to obtain the AirPlay private key which allows you to have your program listed in the AirPlay menus on devices on your network.
You can read about it here. There is also an open source project linked from that page.
http://mafipulation.org/blagoblig/2011/04/08#shairport
Be aware that obviously any application you create will never be approved by apple and the private key could potentially be changed in a firmware/software update.