Awesome
react-native-ux-cam
Installation
# Yarn
yarn add react-native-ux-cam
# NPM
npm i react-native-ux-cam
For iOS, you will need to pod update
as well:
cd ios && pod update && cd ..
Starting from 5.3.0, we no longer support project with react native version <0.60.0. Use manual linking for older version to add UXCam to your project.
iOS 10 is the lowest version supported for recording sessions, which matches the default minimum version for new React Native projects.
Usage
import RNUxcam from 'react-native-ux-cam';
RNUxcam.optIntoSchematicRecordings(); // Add this line to enable iOS screen recordings
const configuration = {
userAppKey: 'YOUR API KEY',
/*
disable advanced gestures if you're having issues with
swipe gestures and touches during app interaction
*/
// enableAdvancedGestureRecognition: false
}
RNUxcam.startWithConfiguration(configuration);
Example apps
A simple Javascript based example app is in the UXCamReactExample folder.
A very simple Typescript example is in the UXCamReactExample-Typescript folder.
For more detailed example using react-navigation, see UXCam-demo-chat-app
Setup
yarn install
yarn add react-native-ux-cam
or if adding locally
yarn add file:/path-to-uxcam-plugin
Add the key from UXCam to App.js file
const configuration = { userAppKey: 'YOUR API KEY', } RNUxcam.startWithConfiguration(configuration);
Running
Android
react-native run-android
iOS
To install the Cocoapod:
cd iOS && pod update && cd ..
Then to run the app:
react-native run-ios
Manual Installation
Setup
# Yarn
yarn add react-native-ux-cam
# NPM
npm i react-native-ux-cam
iOS with react-native and Cocoapods
Add the following to your Podfile:
pod 'RNUxcam', :path => '../node_modules/react-native-ux-cam'
and edit the minimum version of iOS to be >=10.0
Then run:
pod install
Android
-
Go to
android/settings.gradle
addinclude ':react-native-ux-cam'
and on the following line addproject(':react-native-ux-cam').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ux-cam/android')
-
Go to
android/app/build.gradle
addcompile project(':react-native-ux-cam')
under dependencies. -
Go to
android/app/src/main/java/<path-to-main-application>/MainApplication.java
and addimport com.uxcam.RNUxcamPackage;
-
Add
packages.add(new RNUxcamPackage());
insidegetPackages()
before return statement.
Usage
// Import UXCam.
import RNUxcam from 'react-native-ux-cam';
// Add this line to enable iOS screen recordings
RNUxcam.optIntoSchematicRecordings();
// Initialize using your app key.
const configuration = {
userAppKey: 'YOUR API KEY',
/*
disable advanced gestures if you're having issues with
swipe gestures and touches during app interaction
*/
// enableAdvancedGestureRecognition: false
}
RNUxcam.startWithConfiguration(configuration);
Release
- Replace
android/libs/uxcam.jar
latest Android SDK jar file. - Update iOS SDK version on
RNUxcam.podspec
- Update plugin version on
package.json
,android/src/main/java/com/uxcam/RNUxcamModule.java
andios/RNUxcam.m
- Run
npm publish --dry-run
to validate changes. - Run
npm publish
to publish the plugin. - NB: If publishing a beta version then
npm publish --tag=beta
History
This is an updated way of integrating the UXCam SDK react-native following on from the original work by Mark Miyashita (https://github.com/negativetwelve) without whom this would have all been much harder!