Hi Zhoulei,

On Apr 1, 2012, at 4:16 , zhou lei wrote:

> I just try it as what to told me to do, and the client works. Thank you very 
> much.

Glad to hear it works now!

> For property "TEL" in the vcard, it just has too many enum values, how could 
> i set the "TEL" value with its enum flags. If only set it by the 
> setstringvaluebyname, It may use the default one, but i want to set it myself.

The TEL_FLAGS is just an integer field used as a bitmap to create the TYPE 
parameter. So bit 0 set will add HOME, bit 1 WORK etc.

So to make a TEL;TYPE=WORK:123456789 telephone number (all three the same in 
this sample), you would something like:

     // - strings in an array
     sInt32 telFieldID = [aItemKey valueIDByName:"TEL"];
     sInt32 telFlagsID = [aItemKey valueIDByName:"TEL_FLAGS"];
     for (int i=0; i<3; i++) {
       [aItemKey setStringValueByID:telFieldID arrayIndex:i 
toValue:@"123456789"];
       [aItemKey setIntValueByID:telFieldID arrayIndex:i toValue:(1<<1)]; // 
set bit 1 to make it a WORK number
     }

The other fields, "TEL_LABEL" and "TEL_ID" are to support the custom label 
feature of the iOS address book, and also to expose the iOS ID of the array 
elements. If you have your own address book database, you probably don't need 
these and you could remove these extra fields from the XML config as well.

Please also have a look at the conversion modes and options around page 81 of 
the "doc/SySync_config_reference.pdf". Also, on page 86 there is a much simpler 
example of how to map telephone numbers to a few fixed fields (instead of 
arrays). Depending on your address book, that might make more sense to 
implement, rather than using the complex mapping needed for the iOS address 
book which can hold a variable number of TELs for each contact and has custom 
labels and IDs.

Best Regards,

Lukas Zeller



_______________________________________________
os-libsynthesis mailing list
os-libsynthesis@synthesis.ch
http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis

Reply via email to