Perhaps you have suggestions about how to complete my attempt on CardDAV?
Worked like a charm!
Would be nice to have it marked as the solution so that anyone else can skip the rest of the topic.
I wonder if this could be added to the official docs?
Hello
I was fightning with this for whole day, but I am using diffent service than iCloud.
There is an bug in Sailfish OS with autodiscovery (.well-known URL), so you have to enter everything manually and uncheck ‘verify during creation’.
Try this and add two separate accounts, one for calendar and one for contacts:
Adding iCloud Calendar & Contacts to Sailfish OS (manual paths)
Sailfish OS has a bug with /.well-known/ auto-discovery, so you have to enter the full account paths manually. For iCloud, these paths contain your numeric account ID (DSID) and a specific server (pXX-…). You can find both with a single request from a computer.
0. Create an app-specific password
At account.apple.com → Sign-In and Security → App-Specific Passwords, generate a password (e.g. named “Jolla”). Two-factor authentication must be enabled. Use this password everywhere below, not your regular Apple ID password.
1. Find your ID (in a terminal on your computer)
curl -s -X PROPFIND -u "your@email.com" -H "Depth: 0" -H "Content-Type: application/xml" --data-binary '<propfind xmlns="DAV:"><prop><current-user-principal/></prop></propfind>' https://caldav.icloud.com/
When prompted, enter the app-specific password. In the output, look for something like:
<href>/123456789/principal/</href>
That number is your ID.
2. Find the calendar and contacts servers
Replace 123456789 with your ID:
curl -s -X PROPFIND -u "your@email.com" -H "Depth: 0" -H "Content-Type: application/xml" --data-binary '<propfind xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:A="urn:ietf:params:xml:ns:carddav"><prop><C:calendar-home-set/><A:addressbook-home-set/></prop></propfind>' https://caldav.icloud.com/123456789/principal/
The output will contain two addresses, for example:
https://p52-caldav.icloud.com:443/123456789/calendars/
https://p52-contacts.icloud.com:443/123456789/carddavhome/
3. Set up in Sailfish OS (two accounts, custom settings)
Settings → Accounts → Add account → CalDAV and CardDAV
Calendar account:
- Username: your Apple ID email
- Password: app-specific password
- Server address:
https://p52-caldav.icloud.com - CalDAV path:
/123456789/calendars/ - CardDAV path: empty; disable contacts in the account settings
Contacts account:
- Username: your Apple ID email
- Password: app-specific password
- Server address:
https://p52-contacts.icloud.com - CardDAV path:
/123456789/carddavhome/ - CalDAV path: empty; disable calendar in the account settings
Replace p52 and 123456789 with the values your own request returns. If Sailfish doesn’t accept the …/calendars/ path, try /123456789/principal/ instead (on the same pXX server).
Alternatively, you could use Thunderbird or DAVx to obtain this information.
It would, of course, be better if the auto-detection feature worked, though this is an issue that affects other providers as well.
I’m not entirely sure, but as far as I understand, only the person who created the topic can mark it as “solved,” right?
However, they are rarely online in the forum.
Hi! Thanks for very nice instructions. Calendar account is getting 200 OK and info but for some reason contacts response is 404. Why it might happen, do you have any experience of that?
Try checking the server number pXX-contacts.icloud.com can differs for contacts.