Wraps the native Carnival SDK for React Native apps.
Open your Project's Xcode Project.
Drag into "Libraries" the following files from node_modules/react-native-carnival:
- CarnivalReactNativePlugin.h
- CarnivalReactNativePlugin.m
Next, Install Carnival iOS SDK from Cocoapods (add pod 'Carnival'
to your Podfile) or install the framework manually.
Build and Run from Xcode.
- In
android/setting.gradle
...
include ':CarnivalReactNativePlugin', ':app'
project(':CarnivalReactNativePlugin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-carnival/android')
- In
android/app/build.gradle
...
repositories {
maven {
url "https://github.com/carnivalmobile/maven-repository/raw/master/"
}
}
dependencies {
...
compile project(':CarnivalReactNativePlugin')
}
- register module (in MainActivity.java)
import com.carnivalmobile.reactnative.CarnivalReactPackage; // <--- import
public class MainActivity extends ReactActivity {
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new CarnivalReactPackage()
);
}
...
}
We have provided an example JS file for both iOS and Android. Examples of the promised-based wrapper can be found there.