Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No "sync signal" #5

Closed
sadden3194 opened this issue Jan 19, 2021 · 12 comments
Closed

No "sync signal" #5

sadden3194 opened this issue Jan 19, 2021 · 12 comments

Comments

@sadden3194
Copy link

Good morning,

there is a issue - I hope you can help.
I am using "Synology Contacts" (carddav server) in combination with your carddav php script.

Situation 1 (OK):

  • I create a contact via Synology Contacts web interface like this scheme:
    manuell
  • a few seconds later, my apple address book (macOS) shows the new contact:
    Bildschirmfoto 2021-01-19 um 07 48 17

Situation 2 (Issue):

  • I create a contact via carddav php script - contact will successfully created like this:
    automatisch
  • but this contact will not shown in the apple address book
  • If I edit this contact via Synology contacts web interface and save the modification => Contact will shown in apple address book

I asked the Synology hotline for this issue:
They told me, that your script should "send a signal" that the carddav server have to start a synchronization or something like that. maybe a "signal" that something has changed.

Have you an idea?

@mstilkerich
Copy link
Owner

CardDAV clients can either receive changes by regularly polling the server (e. g. every hour) or by server push. Apple has a propriety push service for contacts, that it uses for iOS, maybe also for macOS. I don't know if synology has access to the apple push notification service for contacts. If the server is polled, then I would not expect a new contact to show immediately but only after the next sync / triggering a manual refresh (if thats possible).

In any case, there is no way for a client to tell a CardDAV server that it should trigger a synchronization with other clients after making a change. There is also absolutely no need to, since at the time the client writes a new card to the server the server knows there has been a change.

Unfortunately, I cannot help you with that problem, but I think the answer you got from the support is nonsense.

The only thing I might imagine is that the card you store via script is broken in some way that mac addressbook refuses to process it, and editing it in the synology app may fix the card. For that, you should log the HTTP traffic by passing a HTTP logger to the library and see the vcard that is uploaded. You can paste it here, maybe I can see something obvious that is not ok with it.

@sadden3194
Copy link
Author

can you show me how I can use a http logger?

@mstilkerich
Copy link
Owner

mstilkerich commented Jan 19, 2021

Config::init(
new \Wa72\SimpleLogger\FileLogger('lib.log', \Psr\Log\ LogLevel::DEBUG), 
new \Wa72\SimpleLogger\FileLogger('http.log', \Psr\Log\LogLevel::DEBUG)
            );

@sadden3194
Copy link
Author

Fatal error: Uncaught Error: Class 'Wa72\SimpleLogger\FileLogger' not found in carddav.php:32 Stack trace: #0 {main} thrown in carddav.php on line 32

@mstilkerich
Copy link
Owner

You can run composer update (without --no-dev option) to fetch it. Alternatively you can log to console, for that see quickstart.php for example.

@sadden3194
Copy link
Author

Which code part of QuickStart.php log to console?

@sadden3194
Copy link
Author

Maybe this information can help:

I created a contact manually via web interface and export this contact as vcf

This is the content:

BEGIN:VCARD
VERSION:3.0
FN:Max Mustermann
UID:65ca9d3f-778e-4bb0-8cac-03541beae4d4
N:Mustermann;Max;;;
EMAIL:muster@mail.de
TEL:49651351
ADR:;;STREET 3;CITY;;PLZ;
ORG:Musterfirma;
END:VCARD

I will create the vcard like the same scheme:

$vcard =  new VCard([
		        'FN'	=> 'FIRSTNAME LASTNAME',
		        'N' 	=> ['LASTNAME', 'FIRSTNAME', '', ''],
		        'EMAIL' => 'mail@domain',
		        'TEL'	=> '01251251212',
		        'ADR'   => ['', '', 'MYSTREET', 'MYTOWN', '', 'MYZIP'],
		        'ORG'	=> 'ORGANISATION'
		    ]);

This is the output of "var_dump($vcard)":

object(Sabre\VObject\Component\VCard)#9888 (6) {
  ["version":"Sabre\VObject\Component\VCard":private]=>
  NULL
  ["name"]=>
  string(5) "VCARD"
  ["children":protected]=>
  array(9) {
    ["VERSION"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9860 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(7) "VERSION"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(3) "4.0"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["PRODID"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9864 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(6) "PRODID"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(33) "-//Sabre//Sabre VObject 4.3.3//EN"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["UID"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9883 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "UID"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(50) "sabre-vobject-be2c3d26-44d4-4ae2-a36d-7e764d5f8118"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["FN"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9884 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(2) "FN"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(18) "FIRSTNAME LASTNAME"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["N"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#13334 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(1) "N"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        array(4) {
          [0]=>
          string(8) "LASTNAME"
          [1]=>
          string(9) "FIRSTNAME"
          [2]=>
          string(0) ""
          [3]=>
          string(0) ""
        }
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["EMAIL"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9865 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(5) "EMAIL"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(11) "mail@domain"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["TEL"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9870 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "TEL"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(11) "01251251212"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["ADR"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#9861 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "ADR"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        array(6) {
          [0]=>
          string(0) ""
          [1]=>
          string(0) ""
          [2]=>
          string(8) "MYSTREET"
          [3]=>
          string(6) "MYTOWN"
          [4]=>
          string(0) ""
          [5]=>
          string(5) "MYZIP"
        }
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["ORG"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#9863 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "ORG"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(12) "ORGANISATION"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
  }
  ["parent"]=>
  NULL
  ["iterator":protected]=>
  NULL
  ["root":protected]=>
  *RECURSION*
}

And I get this error messages now:

Issue with N of new VCard: The N property must have at least 5 values. It only has 4
Issue with ADR of new VCard: The ADR property must have at least 7 values. It only has 6

@mstilkerich
Copy link
Owner

Well the error messages tell you what the problem is. See https://tools.ietf.org/html/rfc6350#page-29 for N, you find ADR in the same document.

@sadden3194
Copy link
Author

sadden3194 commented Jan 20, 2021

yes, this is my first version, which works:

$vcard =  new VCard([
		        'FN'	=> 'FIRSTNAME LASTNAME',
		        'N' 	=> ['LASTNAME', 'FIRSTNAME', '', 'Herr', ''],
		        'EMAIL' => 'mail@domain',
		        'TEL'	=> '01251251212',
		        'ADR'   => ['', '', 'MYSTREET', 'MYTOWN', '', 'MYZIP', ''],
		        'ORG'	=> 'ORGANISATION'
		    ]);

var_dump($vcard);

object(Sabre\VObject\Component\VCard)#9867 (6) {
  ["version":"Sabre\VObject\Component\VCard":private]=>
  NULL
  ["name"]=>
  string(5) "VCARD"
  ["children":protected]=>
  array(9) {
    ["VERSION"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9877 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(7) "VERSION"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(3) "4.0"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["PRODID"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9882 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(6) "PRODID"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(33) "-//Sabre//Sabre VObject 4.3.3//EN"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["UID"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9883 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "UID"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(50) "sabre-vobject-11be979b-9c73-45c8-8a00-70a604507894"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["FN"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9853 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(2) "FN"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(18) "FIRSTNAME LASTNAME"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["N"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#9857 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(1) "N"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        array(5) {
          [0]=>
          string(8) "LASTNAME"
          [1]=>
          string(9) "FIRSTNAME"
          [2]=>
          string(0) ""
          [3]=>
          string(4) "Herr"
          [4]=>
          string(0) ""
        }
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["EMAIL"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9880 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(5) "EMAIL"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(11) "mail@domain"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["TEL"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\FlatText)#9858 (10) {
        ["delimiter"]=>
        string(1) ","
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "TEL"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(11) "01251251212"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["ADR"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#9863 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "ADR"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        array(7) {
          [0]=>
          string(0) ""
          [1]=>
          string(0) ""
          [2]=>
          string(8) "MYSTREET"
          [3]=>
          string(6) "MYTOWN"
          [4]=>
          string(0) ""
          [5]=>
          string(5) "MYZIP"
          [6]=>
          string(0) ""
        }
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
    ["ORG"]=>
    array(1) {
      [0]=>
      object(Sabre\VObject\Property\Text)#9854 (10) {
        ["delimiter"]=>
        string(1) ";"
        ["structuredValues":protected]=>
        array(6) {
          [0]=>
          string(1) "N"
          [1]=>
          string(3) "ADR"
          [2]=>
          string(3) "ORG"
          [3]=>
          string(6) "GENDER"
          [4]=>
          string(12) "CLIENTPIDMAP"
          [5]=>
          string(14) "REQUEST-STATUS"
        }
        ["minimumPropertyValues":protected]=>
        array(2) {
          ["N"]=>
          int(5)
          ["ADR"]=>
          int(7)
        }
        ["name"]=>
        string(3) "ORG"
        ["group"]=>
        NULL
        ["parameters"]=>
        array(0) {
        }
        ["value":protected]=>
        string(12) "ORGANISATION"
        ["parent"]=>
        NULL
        ["iterator":protected]=>
        NULL
        ["root":protected]=>
        *RECURSION*
      }
    }
  }
  ["parent"]=>
  NULL
  ["iterator":protected]=>
  NULL
  ["root":protected]=>
  *RECURSION*
}

No errors.
The contact was successfully created:

Bildschirmfoto 2021-01-20 um 08 53 26

But will not shown in the apple address book, like I explained in the first. post :(

** UPDATE **
This is the vcard content of the contact, which I created via web interface and which will be shown in the apple address book:

BEGIN:VCARD
VERSION:3.0
FN:Max Mustermann
UID:a4287900-827b-4ffb-90ee-bb11cf4b0671
N:Mustermann;Max;;;
END:VCARD

This is the vcard content of the contact, which I created via php and which will be NOT shown in the apple address book:

BEGIN:VCARD
VERSION:4.0
PRODID:-//Sabre//Sabre VObject 4.3.3//EN
UID:sabre-vobject-ccd4df1a-81a1-4f18-a815-70ef30c58062
FN:FIRSTNAME LASTNAME
N:LASTNAME;FIRSTNAME;;Herr;
END:VCARD

If I modified the "problem contact" via web interface : It will shown in the apple address book.
This ist the "modified" content

BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.3.3//EN
FN:NewFirstname LASTNAME
UID:sabre-vobject-ccd4df1a-81a1-4f18-a815-70ef30c58062
N:LASTNAME;NewFirstname;;;
END:VCARD

Could it be, that the apple address book has a problem with "Version 4.0"?
How can I change to 3.0 in your script?

@mstilkerich
Copy link
Owner

Maybe. You can set version like any other property to see if it helps. Normally, the CardDAV server must convert a card to 3.0 version if the client does not explicitly request a different version or format.

So simply add to your array when you create the vcard:

'VERSION'	=> '3.0',

In the meantime, I could try myself with a synology server. I cannot reproduce your behavior, but then again I used a client that creates v3.0 cards. For me, mac os contacts will only refresh the server contacts when I quit (command-Q) the program completely and start it again, then it would sync on start. This is even when I configure it to update every minute. With a nextcloud server, I don't get any contacts downloaded with apple contacts at all...

@sadden3194
Copy link
Author

I am using the DSM 7.0 Beta of Synology.
The CardDAV Server doesn't work anymore. the new cardDAV server is now "Synology Contacts"

And you know what?
After I set the Version to 3.0 - it works !!! :)

@mstilkerich
Copy link
Owner

Great that it works for, as I said my experience using mac os contacts with anything different than iCloud was less positive :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants