Today we’re pleased to announce that AgileCloudSDK is officially open source and available on GitHub. AgileCloudSDK is a framework that we’ve built for the purpose of bringing iCloud sync to the AgileBits Store version of 1Password. AgileCloudSDK allows us to take our existing iCloud sync solution and make it work outside the Mac App Store.
Get the Code
Enough with the pleasantries, let’s get to it! All of the code is up on GitHub. The repository includes the framework, two sample apps (one using CloudKit, the other using AgileCloudSDK), and instructions on how to get set up.
Using both CloudKit JS and CloudKit REST Services, AgileCloudSDK is a drop-in replacement for the official CloudKit framework. Its core functionality is compatible enough that for our sync code, the only difference between it and CloudKit is which framework header we import. The gap is a little wider for sync setup, because OS X and iOS handle all the authentication automatically when using CloudKit.
When using CloudKit JS or the REST Services, authentication is not handled automatically. In this case, AgileCloudSDK brings the user to the CloudKit authentication page in their browser. After a successful login, an authentication token is returned to the app.
The differences in authentication required us to modify how sync is configured in 1Password, but thankfully the changes we had to make were fairly minimal.
One of the many benefits of using AgileCloudSDK is that developers can target either the development or production CloudKit container, which is invaluable for debugging issues in a production environment.
The first stage of AgileCloudSDK development was to simply build this thing for our own purposes. It was important to us that we explain to our users how we managed to get iCloud sync outside the Mac App Store; announcing the framework a few months ago was our way of doing that.
The next phase was to get more real-world experience with the framework and to fix issues as they came up. We’ve been refining AgileCloudSDK and we’re really happy with how it’s working out so far, and we think it’s ready for others to use it.
We’re now entering the third phase of AgileCloudSDK development. This is where we would love all you app developers to get involved. AgileCloudSDK contains implementations of every CloudKit class that 1Password uses, which is the majority of them. See our GitHub project page for a list of classes that are not implemented. We’d love for AgileCloudSDK to implement 100% of the CloudKit API.
We used both CloudKit JS and CloudKit REST Services to implement AgileCloudSDK. CloudKit JS is almost always the quickest way to get something built, but the REST services allow more flexibility. We’d love to see more code converted to using only the REST services, with the goal of one day breaking the dependence on any main-thread processing.
For general feedback, leave a comment below or e-mail us at firstname.lastname@example.org. If you have questions or comments on implementation, or if you find a bug, please file an issue in the repo.