Skip to content

negativetwelve/react-native-ux-cam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-ux-cam

Deprecation of this repo

As of version 5.1.15, published 5 March 2020, we are moving to https://github.com/uxcam/react-native-ux-cam for all future updates.

If you have issues, feature requests, pull requests etc. please put them in there.

Thanks! Richard @ UXCam

Installation

$yarn add file:/path-to-the-uxcam-react-wrapper

$react-native link react-native-ux-cam

For react-native version 0.60 if using iOS you then need to:

cd ios

Edit the Podfile first line to be platform :ios, '10.0' rather than platform :ios, '9.0' then run the following to install the CocoaPods:

pod update && cd ..

Usage

import RNUxcam from 'react-native-ux-cam';
RNUxcam.optIntoSchematicRecordings(); // Add this line to enable iOS screen recordings
RNUxcam.startWithKey('YOUR API KEY');

For testing example 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

RNUxcam.startWithKey('YOUR UXCAM API KEY GOES HERE');

Running

Android

react-native run-android

iOS

cd iOS Edit the Podfile first line to be platform :ios, '10.0' rather than platform :ios, '9.0' then run the following to install the CocoaPods:

pod update && cd ..

react-native run-ios

Manual Installation

Setup

# Yarn
yarn add react-native-ux-cam

# NPM
npm install --save 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

  1. Go to android/settings.gradle add include ':react-native-ux-cam' and on the following line add project(':react-native-ux-cam').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-ux-cam/android')

  2. Go to android/app/build.gradle add compile project(':react-native-ux-cam') under dependencies

  3. Go to android/app/src/main/java/com/terravion/dbug/MainApplication.java add import com.rnuxcam.rnuxcam.UXCamPackage;

  4. Add the following to your file android/app/build.gradle (or add the maven url to your existing repositories section):

allprojects {
    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
    maven { url "$rootDir/../node_modules/react-native/android" }
    maven { url "http://sdk.uxcam.com/android/" }
}
  1. And add this to your file android/app/src/main/AndroidManifest.xml, inside your <application> tag:
<service android:name="com.uxcam.service.HttpPostService"/>

Usage

// Import UXCam.
import UXCam from 'react-native-ux-cam';

// Add this line to enable iOS screen recordings
UXCam.optIntoSchematicRecordings(); 

// Initialize using your app key.
UXCam.startWithKey(key);

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!