I go through developer.couchbase.com/mobile/get-started/get-started-mobile/net-mobile/before-you-begin/index.html couchbase documentation. But i am not getting how to use couchbase in Xamarin.Forms PCL project. Can anyone explain how to use in Xamarin.Forms project..
Thanks,
Mahabaleshwar Hegde
Posts
I don't think this is officially supported yet. However I think if you clone the source code for the Couchbase Mobile product from GitHub I seem to recall someone submitting a pull request that supported usage in PCLs, so you may be able to get it that way.
An alternative route could be to create your PCL-based solution, then add the Couchbase Mobile product to a Shared Project within that solution and reference it from the PCL.
@DavidDancy Thanks for your reply.Please let me provide resources or examples if any
Mabu,
You can use the Xamarin Forms DependencyService to call out from the PCL to code in your platform project to achieve this.
@AlecTucker.1318 ,
i have to install Couchbase lite nuget package in all platform. right?
@Mabu I used the Xamarin Component Store to install Couchbase Lite. But I think you can achieve the same effect by using NuGet to install all the required packages.
@DavidDancy thanks. I will check.
couchbase.lite can only be used in 'don't link' Linker Behaviour.
Does anyone know how to use this in 'Link framework sdks only' in Xamarin.froms?
Thanks.
@Mabu Did you solve the problem of using CouchBase.lite in your PCL through DependencyService? Does this mean I have to write my own Wrapper aroung the Couchbase API?
@ThomasBurkhart - when I did this last year, I did need to write a wrapper class for the PCL. I chose not to actually do 1:1 wrapping, but created roughly 15 methods that provided the basic CRUD and sync functionality for CB - fairly specific to how I was using my application (unfortunately not a "generic" framework).
Ok, so I will do the same. You can always add more methods if needed.
I am not able to finding couchbase lite client for Xamarin forms (UWP and Window 8.1). Got couchbase lite client for Android and IOS. What would be the best way to implement couchbase lite in xamarin forms's PCL, So it can be share between all the platforms ( i.e Android , IOS, UWP and Windows 8).
@DavidDancy
"I don't think this is officially supported yet. However I think if you clone the source code for the Couchbase Mobile product from GitHub I seem to recall someone submitting a pull request that supported usage in PCLs, so you may be able to get it that way.
An alternative route could be to create your PCL-based solution, then add the Couchbase Mobile product to a Shared Project within that solution and reference it from the PCL. "
anything on it ? is it possible to do so ?
@dinkualoha AFAIK there's no PCL-based version either available or in planning. However if you really want to know, you could raise an issue about it on the project at https://github.com/couchbase/couchbase-net-client.
I am playing around with it. What I did is turn my project into a netstandard 1.4 project and used the 2.0 beta. It compiles and seems to be working for basic stuff... Haven't done much testing though but it could be a start
Any help on this? I need to include couchbase in PCL. How to achieve this? Any example.