We have published the Xamarin client library on GitHub under the Apache 2 license.
While the structure of the library is fundamentally the same as the Unity and Windows Phone ones there is a difference in how we gather device information to register the client with the cloudbase.io API. The CBHelper solution contains three projects:
- CBHelper-Xamarin: The actual client library.
- CBHelper-Xamarin-Android: An Android specific library.
- CBHelper-Xamarin-iOS: An iOS specific library.
The main CBHelper project defines a class called CBDeviceInfo. This is an empty container declaring the variables necessary for the device to be registered with cloudbase.io. The Android and iOS projects contain only one class, an implementation of the CBDeviceInfo class called AndroidDeviceInfo and iOSDeviceInfo. These two projects use the platform specific classes to extract information about the manufacturer, versions and IDs through the MonoTouch and Android frameworks for Mono.
The client library works in exactly the same way as the Windows Phone client library. The only difference is in the constructor of the CBHelper object which expects an additional parameter in the form of a CBDeviceInfo object.
CBHelper helper = new CBHelper (
"xamarin-app-code", // the application code on cloudbase.io
"aa11aa", // the application unique code on cloudbase.io
new iOSDeviceInfo () // the CBDeviceInfo object, in this case for iOS
// If you were building for Android you'd use the AndroidDeviceInfo class.
The Xamarin developer’s community is growing very fast and we have received numerous requests to add Xamarin support to our extensive collection of client libraries. We look forward to your feedback as we keep developing the system and extending our support for the Xamarin SDK.