Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remobile/react-native-cordova
A cordova plugin bridge for react-native
https://github.com/remobile/react-native-cordova
Last synced: about 2 months ago
JSON representation
A cordova plugin bridge for react-native
- Host: GitHub
- URL: https://github.com/remobile/react-native-cordova
- Owner: remobile
- License: mit
- Created: 2015-11-18T02:11:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-27T04:36:40.000Z (over 3 years ago)
- Last Synced: 2024-05-13T08:02:04.941Z (8 months ago)
- Language: Java
- Size: 63.5 KB
- Stars: 49
- Watchers: 6
- Forks: 18
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-react-native-native-modules - react-native-cordova ★35 - native. (<a name="Utility-&-Build-&-Publish:-Native-Modules">Utility, Build & Publish: Native Modules</a>)
README
# React Native Cordova (remobile)
A cordova plugin defines for react native on ios and android## Installation
```sh
npm install @remobile/react-native-cordova --save
```
### Installation (iOS)
* Drag RCTCordova.xcodeproj to your project on Xcode.
* Click on your main project file (the one that represents the .xcodeproj) select Build Phases and drag libRCTCordova.a from the Products folder inside the RCTCordova.xcodeproj.
* Look for Header Search Paths and make sure it contains $(SRCROOT)/../../../react-native/React as recursive.* In your project, Look for Header Search Paths and make sure it contains $(SRCROOT)/../../react-native-cordova/ios/RCTCordova.
* then you can #import "CDVPlugin.h"### Installation (Android)
* In Main project `build.gradle`
```gradle
...
include ':react-native-cordova'
project(':react-native-cordova').projectDir = new File(settingsDir, '../node_modules/@remobile/react-native-cordova/android/RCTCordova')
```* In you project `build.gradle`
```gradle
...
dependencies {
...
compile project(':react-native-cordova')
}
```* then you can import com.remobile.cordova.* ;
## Usage
### IOS
```java
#import "CDVPlugin.h"
...
@interface CustomClass : CDVPlugin
@end
...@implementation CustomClass
RCT_EXPORT_MODULE(RCTCustomClass)
RCT_EXPORT_CORDOVA_METHOD(test);
...
- (void) test:(CDVInvokedUrlCommand *)command {
...
}
....
@end
```
### Android
```java
import com.remobile.cordova.*;
...
public class CustomClass extends CordovaPlugin {
...
public CustomClass(ReactApplicationContext reactContext) {
super(reactContext);
}
...
@Override
public String getName() {
return "Sqlite";
}
@ReactMethod
public void test(ReadableArray args, Callback success, Callback error) {
executeReactMethod("test", args, success, error);
}
...
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
if (action.equals("test")) {
....
return true;
}
....
return false;
}
}
```# Project List
* [react-native-camera](https://github.com/remobile/react-native-camera)
* [react-native-contacts](https://github.com/remobile/react-native-contacts)
* [react-native-dialogs](https://github.com/remobile/react-native-dialogs)
* [react-native-file-transfer](https://github.com/remobile/react-native-file-transfer)
* [react-native-image-picker](https://github.com/remobile/react-native-image-picker)
* [react-native-sqlite](https://github.com/remobile/react-native-sqlite)
* [react-native-file](https://github.com/remobile/react-native-file)
* [react-native-zip](https://github.com/remobile/react-native-zip)
* [react-native-capture](https://github.com/remobile/react-native-capture)
* [react-native-capture](https://github.com/remobile/react-native-capture)
* [react-native-local-notifications](https://github.com/remobile/react-native-local-notifications)