[Windows Phone 8 Development and Hacking] compu829:
Hey guys,

I just tossed together a quick tutorial that will allow you to use the built-in IMAP, CalDav, and CardDav support in WP8 GDR2 to sync with Apple's iCloud services! This "hack" should work with any IMAP/CalDAv/CardDav accounts you may have.

*NOTE* For some reason the calendar entries are off by 5 hours (I am in the Eastern Time Zone) when compared between the windows phone and my Apple devices. Also, some ancient recurring entries in a shared calendar don't seem to come in properly for me for some reason. I am guessing the version of CalDAV on Windows Phone does not properly deal with Time Zones.

Instructions inspired by BlackBerry.com http://btsc.webapps.blackberry.com/...nisa.apps.common.BaseViewedDocsListHelperImpl

1. Go to Settings --> email +accounts --> and click "add an account"

2. Select "Google"

3. When prompted, enter a valid Gmail address and password. (we will fix this later)

4. Wait patiently for the initial sync to finish..(It may take up to 5 mins)

5. Locate the account that you created and tap on it to open the account settings...(It will be called Google, Google 2, etc).

6. Change the "Account Name" to something meaningful (I changed mine to iCloud)

7. Change the email address to the one you use for iCloud. *NOTE* If you don't use iCloud mail, enter a dummy email address here that is different from any other email address already on the device.

8. Set "download new content" to a value that you prefer. (Mine is set to every 15 mins)

9. Set "Download email from" to an appropriate value.

10. in the "content to sync" section, check which iCloud info you want to sync. (Email, Contacts, or Calendar)

11. in the "Your Name" field, enter your name.

12. If you will be using IMAP to sync with iCloud email, change the Incoming email server to "imap.mail.me.com:993", if not skip this step.

13. for the User Name, enter your iCloud user name. (Mine is my apple id because I never made an iCloud email account)

14. for the password enter your password.

15. If you will be using IMAP to sync with iCloud email, change the Outgoing email server to "smtp.mail.me.com:587", if not skip this step.

16. If you will be using IMAP to sync with iCloud email, make sure "Outgoing server requires authentication" is checked, if not skip this step.

17. For the "Contacts server (CardDAV)" enter "contacts.icloud.com".

18. for Calendar server (CalDAV)" enter "caldav.icloud.com".

19. Click the "Check" box to save your settings.

20. Check to see if things are syncing!

*NOTE* If the calendar sync is not working, it may be necessary to change you CalDAV server name to p0#-caldav.icloud.com, where # is represents the numbers 1-9. Example: p05-caldav.icloud.com or p04-caldav.icloud.com). If you don't want to experiment, there are instructions online on how to pull the right server name from Apple's Calendar app.

**EDIT** More Info on Time Zones:

1. When The Windows Phone sends the info about the event to the CalDav Server, the phone tells iCloud the event is in "Eastern Standard Time". (It should be "Eastern Direct Time" bc DST.) When the CalDAV Server correctly sends this data back to the phone, the phone processes as "Eastern Standard Time" and "bumps" the event forward an hour. The phone also doesn't send all the proper TimeZone info back to the server in the ICS file, resulting in a non-editable event in the iCloud calendar. If you Switch the displayed time zone from "Eastern Standard Time" to "Eastern Time" in the iCloud Calendar app, you can edit the event. When it comes back to the phone, it will be off by 4 hours due to the processing bug (see 2)

2. CalDAV entries that are created in iCloud come back to the device with a time zone of "US/Eastern". I am guessing there is a parsing bug in the app so that when it sees the "/", it freaks out, stops processing the TimeZone data contained in the ics file, and leaves the entry as GMT.

A couple of ways that may fix the TimeZone issue with the calendars:

1. Turn on TimeZone Support vial iCloud.com or the Calendar app. Make all your entries in the "Floating" time zone. This forces all calendar entries to be set with the "Real" time on the server and strips out TimeZone calculation.