1.6.1 • Published 7 years ago

react-native-couchbase v1.6.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

react-native-couchbase

React native Couchbase allows to create a couchbase server.

Installation

npm install --save react-native-couchbase

or manually

git clone the directory to [node_modules/react-native-couchbase]

Guide

  • Initialising: How to start couchbase.

  • Functions: Available functions to interact with couchbase.

  • Events: All the different events emitted.

Setup

Android

  • In android/setting.gradle
...
include ':CouchBase', ':app'
project(':CouchBase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-couchbase/android')
  • In android/app/build.gradle
android {
    ...
    
    // workaround for "duplicate files during packaging of APK" issue
    // see https://groups.google.com/d/msg/adt-dev/bl5Rc4Szpzg/wC8cylTWuIEJ
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}


dependencies {
    ...
    compile project(':CouchBase')
}
  • give internet and network-state access, in android/app/src/main/AndroidManifest.xml:

<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    ...
</manifest>
  • register module (in MainActivity.java)
import com.upinion.CouchBase.CouchBasePackage;  // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
  ......
    
    /**
     * A list of packages used by the app. If the app uses additional views
     * or modules besides the default ones, add more packages here.
     */
    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
        new MainReactPackage(),
        new CouchBasePackage()
      );
    }
}

iOS

  1. Download Couchbase Mobile for iOS and add the libraries to the React native project, including CBLRegisterJSViewCompiler.h
  2. Add the project RCTCouchBase to the React Native project.
  3. In RCTCouchBase, in Header Search Paths, add the route to your ${react native mobile application}/node_modules/react-native/React folder and also Frameworks headers
  4. In the React Native project, you have to add the following frameworks and libraries to your Build phase:
    • libCBJSViewCompiler.a
    • libRCTCouchBase (from the product folder in RCTCouchBase)
    • CouchbaseLite.framework
    • CouchbaseLiteListener.framework
    • CFNetwork.framework
    • Security.framework
    • SystemConfiguration.framework
    • libsqlite3.dylib
    • libz.dylib
  5. Compile RCTCouchBase and run the React native project.
1.6.1

7 years ago

1.6.0

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago