Synchronize the contacts and calendar of your Blackberry 10 with OwnCloud
The new Blackberry 10 devices support CalDAV as well as CardDAV. With a bit of modifications of your Owncloud installation, it is possible to synchronize your calendar with CalDAV and your contacts with CardDAV.
Based on Nicolas Vivien’s modifications, I implemented my own patched Ownloud server. Nicolas helped me a lot tracing down the various problems and stumbling blocks.
First of all some important Blackberry limitations
On the current Blackberry 10 OS (10.9.10.35), CardDAV only works with a server which supports HTTPS. On the other side, CalDAV also accepts an insecure HTTP server (but first tries HTTPS).
Hopefully Blackberry will fix this in the near future.
My Workaround
Since my hoster only provides HTTPS at an extra cost, I had to look for another solution.
Luckily, my Synology DiskStation als has a webserver and even provides HTTPS.
So I moved my OwnCloud installation to my local DiskStation which is accessible through HTTP over the internet.
Required OwnCloud modifications
To keep the server addresses of the Server short, I added some htaccess RewriteRules to the root directory of my webserver:
RewriteEngine on RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{HTTP_HOST} ^carddav RewriteCond %{REQUEST_URI} !^/apps RewriteRule .* /owncloud/apps/contacts/carddav.php/$1 [L] RewriteCond %{HTTP_HOST} ^caldav RewriteCond %{REQUEST_URI} !^/apps RewriteRule .* /owncloud/apps/calendar/caldav.php/$1 [L]
This will redirect any call from https://carddav.DOMAIN.ch/ to https://DOMAIN.ch/owncloud/apps/contacts/carddav.php and https://caldav.DOMAIN.ch to https://DOMAIN.ch//owncloud/apps/calendar/caldav.php.
You then should see pages similar to this:
principals | Collection | 2013-03-17T13:43:01+00:00 | ||
calendars | Collection | 2013-03-17T13:43:01+00:00 |
and
principals | Collection | 2013-03-17T13:44:48+00:00 | ||
addressbooks | Collection | 2013-03-17T13:44:48+00:00 |
Note:
Due my modifications, A direct call to the redirected URLs will lead to a Sabre_DAV_Exception_NotFound exception! How ever this doesn’t matter in normal operation since you can always use the much shorter and nicer sub domain call.
Blackberry configuration
CalDAV account
Description: [What ever you want]
User name: Your Owncloud user name
Email address: [Blackberry requires a valid emailadress. How ever Owncloud will ignore it]
Password: Your Owncloud password
Server address: carddav.DOMAIN.ch/calendars/USERNAME/defaultcalendar [add the /calendars/USERNAME/defaultcalendar, where USERNAME has to be replaced by your real user name, else Blackberry will not list the account. If you only have HTTP, you will heve to append a http://, else it uses implies https://]
CardDAV account
Description: [What ever you want]
User name: Your Owncloud user name
Email address: [Blackberry requires a valid emailadress. How ever Owncloud will ignore it]
Password: Your Owncloud password
Server address: carddav.DOMAIN.ch [omit the HTTPS://]
Required OwnCloud modifications
Jet to be documented…
For now, have a look at Nicolas’s patches: http://www.progweb.com/2012/05/playbook-pret-pour-le-cloud/
Schöner post:)
I experienced some issues with the calendar. After setting up the CalDAV account, all events shows up nicely. After short time (synchronisation finished?) they disappear. This affects all events imported into OwnCloud 5.0.5 from Google calendar via file import. Events created directly in OC, regardless via web front-end or via BB10 still remains. I can reproduce this issue by changing any settings of the CalDAV account (sync interval): events come…and go.
I just tried adding a calendar on 10.1, using owncloud 5.0 and it was straightforward.
I did set the full URL, including the protocol, but I just used what was shown to me in the calendar settings:
https://mydomain.com/remote.php/caldav
I didn’t set any email address and it worked, but I can’t invite anybody, so I’m wondering if it’s due to a caldav limitation or to the fact that I didn’t include any email address…
How is it that you already are on 10.1? I am still stuck on 10.0.9.2372.
Did you have to do any modification on Owncloud?
I integrated the 4.5 changes into the 5.0 some weeks ago, but had some weird issues with the calendar (events not seen on device sporadically or disappearing for a while).
Can you describe a bit more what you mean by „inviting somebody“?
The Q10 has 10.1 and it’s also possible to manually upgrade your Z10 to 10.1.0.1483 with this updater:
https://mega.co.nz/#!aN4DRZiZ!YP-tYETv3xQBYVfqC5RsM0WqyHoQtKb-G4Ymf1gn-WY
Don’t update to 1627. It’s a beta.
I have done zero modification of owncloud, but I do use https, because there are passwords involved.
I haven’t performed any form of extensive testing either. Just created a few events and they synced.
When you’re using ActiveSync, because the accounts is linked to an email, you can invite people to a meeting using your email address. This is greyed out in this owncloud account, but probably because I didn’t include an email address. The device doesn’t let me add it after registration, so I’ll have to try with another account.
For my daily usage, I use a calendar synced with a modified OwnCloud 4.5. In my BB version I still had to enter an email address. I just tested the invitation thingy: I invited somebody on an M$ Exchange Server. The person got the invitation and could agree to the event. It then got added to his calendar and I got an Email notification. Also it got correctly updated in the calendar entry on my device. It seems also to be synced to the OwnCloud calendar. At least Thunderbird shows the person as an invitee but cant show the status of the invitation. In Owncloud itself nothing about the invitee is visible.
So I suggest to delete the account on your device and re-add it with an email address.
Please also let us know about your experience with syncing to Owncloud 5. I tried it myself but like said had some mixed experience.
Also on Owncloud 4.5 I saw some weird behaviour: I added a 2nd calendar to Owncloud and to the device. First it seemed to work fine, the newly added events got synced in both ways. How ever after a while the events suddenly disappeared from the device. I am not sure if it is an issue of Owncluod or BB10. My primary calendar still works fine.
So if you have any experience with multiple calendars, please also let us know.
Most likely I will wait with more experiments until I get BB10.1.
Thanks for the info. I tested with the email address and it lets me add participants :).
Sync works well, but events from Owncloud take some time to get sent to the device. Maybe it’s because I was logged in?
Tasks don’t seem supported, but I think it’s more of a Owncloud issue. I couldn’t find any documentation on that.
BB 10.1.0.1720 / Owncloud 5.0.5
The sync is completely independent by what you are doing in Owncloud! In fact the sync is initiated by the device. So maybe you set a too high interval?
I had forgotten about that. I’m used to ActiveSync and its push system…
Hmm, never played around with that, why don’t you use CalDAV?
I don’t see any disadvantage except the little delay.
Active Sync supports events, tasks and notes. CalDAV on OC apparently only supports events, but I’m still interested in switching, one day.
Update on the sync…it’s as bad as all the other system I’ve tested 😉
I’ve made a modification on the device and ended up with a duplicate on Owncloud. Then an event disappeared from the device.
All while using a single calendar.
Thats interesting 🙁
I am syncing now already for a while and never experienced something like this. Maybe its due the never version of Sabre (CalDAV backend in OwnCloud) or newer BB version.
Here is my test case:
– Create event on Owncloud, no notes
– Wait for event to show on device or at least more time than the sync delay
– Make the event last longer on OC
– On the device, set it back to what it was previously
This created 2 events in my OC.
I still have one event which isn’t shown on the device most of the time, but shows up from time to time. Very strange 🙂
I tried to reproduce this with CalDAV, but it works fine for me.
Maybe its due your ActiveSync implementation?
ActiveSync is a separate setup. I’m using CalDAV when connecting to OC ;). I’m just playing with various tech in order to find one which works reliably 🙂
Do you plan to complete this documentation on getting CardDAV to work on a BlackBerry 10 device for ownCloud?
I was planning to move to OC5 and document it there. Since some of my required apps are not yet available there, I stick to OC4.5.
I just 2 days ago got my Z10, so I first want to play around a bit and see how stable it is on OC4.5 before I move to OC5.
But then I will give it a try and document it.
Until then, if you have any questions, just let me know.