I have a mobile app where people store their contacts. I want to be able to sync these contacts with the phone so if anyone calls my users they would have the name in the address book and show it when getting the call.
I was thinking about implementing carddav or similar protocol, so my users could add this account to their phone and sync with it (it would be read only). I thought it was easy with just returning an xml for a certain endpoint with basic auth, but I'm not finding examples.
Other idea was that I run a carddav server and both my backend and the user could connect to it. My backend would fill it for the user and my user could sync with it from his phone.
I would prefer the first, implementing my own endpoint. Would it be enough if I just reverse engineer the carddav endpoints and build up the xml results on my own? Any guides or very easy implementations? Of course I won't need the full specification implemented for this. My preferred environment is nodejs but if it's an easy implementation of course I could bring it over from other languages.