1

I'm going to build an online addressbook that synchronizes with the Mac OS X internal addressbook application. I use the famous Baikal (http://baikal.codr.fr/) Server to connect both applications (web app and mac os x app).

Now i want to add contacts online (contact files are based on a sqlite database), but i don't know how to create an UUID for Apples .vcf cards. They look like this:

BEGIN:VCARD
VERSION:3.0
PRODID:-//Apple Inc.//Address Book 6.1.2//EN
N:Test;Test;;;
FN:Test Test
REV:2012-07-09T20:19:39Z
UID:036f8e50-4b4d-49e1-82fb-089181227b15
END:VCARD

Does anyone know, how i can create an UUID for .vcf files?

Kara
  • 6,115
  • 16
  • 50
  • 57
Slevin
  • 4,268
  • 12
  • 40
  • 90

1 Answers1

3

First of all, Apples Address-Book does not require any special Apple-.vcf-Card, but uses general vCards for Address-Exchange.

You should be able to use any unique Identifier as 'UID'. It's purpose is to identify a card as unique so that you can use the same UID for a second card that will update the content of the first card (for instance when a user changes name or the address changes).

I'm not even sure it has to be a UUID it just has to be unique. So you could use one of the many UUID-Generators out there (ask your favourite Search Engine for one) or have a look here: PHP function to generate v4 UUID

And a look at the vCard-RFC might be a good idea also (RFC 2426)

Community
  • 1
  • 1
heiglandreas
  • 3,803
  • 1
  • 17
  • 23