카우치베이스 라이트임베디드 NoSQL 데이터베이스 for iOS, Android and .Net platforms. The framework’s API supports native platform bindings for Android (Java), iOS (Swift, ObjC) and UWP/Xamarin (csharp). This implies that if you are building a React Native app in Javascript and you want to use Couchbase Lite as your embedded data persistence layer, you will have to find a way to access Couchbase Lite’s native APIs from the React Native Javascript world. You can accomplish that with React Native Modules.

React Native Modules allow mobile apps written in 리액트 네이티브 to access native platform APIs that do not have a corresponding React Native module.

아키텍처

At a high level, the architecture of an a React Native app that uses React Native Modules is pretty straightforward.

  • The UI layer is written in Javascript and is common across mobile platforms
  •  The data persistence or model layer is written in native platform language and is responsible for interfacing with Couchbase Lite. The functions of this layer are exposed through a set of native APIs
  • The native APIs are exported to the Javascript UI using React Native Modules

튜토리얼

We have put together two tutorials, one for Android 그리고 하나는 iOS. Each tutorial will walk you through the steps of how you can build a React Native Module to interface with Couchbase Lite 2.x  from within your React Native app.

We will be working with a very simple app called the “Hotel-Finder”. This app allows users to

  • Search for hotel documents from a local Couchbase Lite database
  • Bookmark a hotel and store the bookmark in Couchbase Lite
  • Unbookmark previously bookmarked hotels

So let’s get started!

If you are developing for iOS, you can get started with the iOS tutorial and if you are developing for Android, follow the instructions in the Android tutorial.

다음 단계

After completing the tutorial, you should have a good idea of how to use Couchbase Lite as a local data store within your React Native apps on iOS and Android. Stay tuned for future tutorials that demonstrate how you can use Cordova plugins to access Couchbase Lite from within your hybrid apps.

질문이나 피드백이 있으면 아래에 댓글을 남기거나 트위터로 언제든지 문의해 주세요. @rajagp 또는 다음 주소로 이메일을 보내주세요. priya.rajagopal@couchbase.com. . 카우치베이스 포럼 를 통해 질문할 수 있습니다.

감사

다음 분들께 감사드립니다. 제임스 노센티니 for his contributions to the tutorials and for the development of the sample apps.

 

작성자

게시자 프리야 라자고팔, 제품 관리 부문 선임 이사

프리야 라자고팔은 클라우드 및 엣지용 개발자 플랫폼을 담당하는 Couchbase의 제품 관리 수석 이사입니다. 그녀는 20년 이상 여러 기술 및 제품 리더십 직책을 맡으며 전문적으로 소프트웨어를 개발해 왔으며, 그중 10년 이상은 모바일 기술에 집중했습니다. TISPAN IPTV 표준 대표로서 IPTV 표준 사양에 핵심적인 기여를 했습니다. 네트워킹 및 플랫폼 보안 분야에서 22개의 특허를 보유하고 있습니다.

댓글 하나

  1. Any idea how/what(any couchbaselite?) we can use for electronjs(https://electronjs.org/) based windows 10 desktop application that eventually could sync with couchbase server?

  2. Don’t know exactly how but we do have .Net version of Couchbase Lite (and .Net core ) which you can be leverage within your electron.js app

  3. Very good blog. It’s important that every [React Native development company](https://www.pyramidions.com/react-native-development-company.html) sees this. Will share it with my peers. Thank you.

댓글 남기기