# AppGallery Connect Cloud DB for Cordova

## Introduction
   Cloud DB is a device-cloud synergy database product that provides data synergy management capabilities between the device and cloud, unified data models, and various data management APIs.
[Learn More](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-clouddb-introduction)

## Installing the Plug-in
Install AGC Cloud DB plugin to the project

### Cordova

`$ cordova plugin add @cordova-plugin-agconnect/clouddb --save`

For more details, please refer to [Getting Started with Cordova](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started-cordova)

### Ionic

`$ ionic cordova plugin add @cordova-plugin-agconnect/clouddb --save`

Install `Ionic-Native AGC CloudDB` to the project.

`$ npm install @ionic-native/core @cordova-plugin-agconnect/ionic-native-agc-clouddb`

For more details, please refer to [Getting Started with Ionic](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started-ionic)

## Development Guide
- [Usage](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-clouddb-cordova-usage-0000001106653402)
- [Reference](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/cordova-clouddb-overview-0000001149210649)

## Development Environment
You are advised to use the plug-ins in an environment that meets the following requirements.

| Software        | Allowed Version Range | Description  |
| --------------- | --------------------- | ------------ |
| cordova         | 9.0.0 or later        | Platform     |
| cordova-android | >=8.1.0 or later      | Platform     |
| cordova-ios     | 5.0.0 or later        | Platform     |
| npm             | 6.4.1 or later        | Tool         |

## 5. FAQs

Why is the message 'google/protobuf/any.h' file not found file not found displayed when I run pod install?

Protobuf-C++ causes the problem.

You can fix this problem by following the steps below.

1. Delete `<project_root>/platforms/ios/Podfile.lock` file.
2. Delete `use_frameworks!` line in `<project_root>/platforms/ios/Podfile` file.
3. cd `<project_root>/platforms/ios` directory and run this command `pod install`

##  License
   Cloud DB Plug-in is licensed under the: [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).  

