Skip to content
It is a react native component for Enablex users.
Java Swift JavaScript Objective-C Ruby
Branch: master
Clone or download
Latest commit 208e1d9 Jan 15, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
android Bugs fixes and improvments Jan 9, 2020
ios Update RNEnxRtc.podspec Jan 15, 2020
src Bugs fixes and improvments Jan 9, 2020
.DS_Store Fixed release version to beta Jan 9, 2020
README.md Updates with latest SDK 1.5.3 , bug fixes and file sharing features Jan 2, 2020
jsconfig.json Initial Commit May 6, 2019
package.json Fixed release version to beta Jan 9, 2020

README.md

enx-rtc-react-native

Getting started

Pre-Requisites:

  1. Install node.js

  2. Install and update Xcode (you will need a Mac)

  1. Install and update Android Studio

Installation:

$ npm install enx-rtc-react-native --save

Mostly automatic installation

$ react-native link enx-rtc-react-native

iOS Installation

Note: Please make sure to have CocoaPods on your computer. If you've installed this package before, you may need to edit your Podfile and project structure because the installation process has changed.

  1. In you terminal, change into the ios directory of your React Native project.

  2. Create a pod file by running: pod init.

  3. Add the following to your pod file:

target '<YourProjectName>' do

# Pods for <YourProject>
pod 'EnxRTCiOS'
pod 'Socket.IO-Client-Swift', '~> 15.0.0'
end

  1. In case if you want Autolinking then don't do step 3. Add following in podfile: ... pod 'enx-rtc-react-native', :path => '../node_modules/enx-rtc-react-native/ios/RNEnxRtc.podspec' Note:- Kindly make sure "Bitcode" = No in your project. ...

  2. Now run, pod install

  3. After installing the EnxRTCiOS SDK, change into your root directory of your project.

  4. Now run, react-native link enx-rtc-react-native.

  5. Open <YourProjectName>.xcworkspace contents in XCode. This file can be found in the ios folder of your React Native project.

  6. Click File and New File

  7. Add an empty swift file to your project:

  • You can name this file anything i.e: EnxInstall.swift. This is done to set some flags in XCode so the Swift code can be used.
  1. Click Create Bridging Header when you're prompted with the following modal: Would you like to configure an Objective-C bridging header?

  2. Ensure you have enabled both camera and microphone usage by adding the following entries to your Info.plist file:

<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microphone is accessed for the first time</string>

If you try to archive the app and it fails, please do the following:

  1. Go to Target
  2. Click on Build Phases
  3. Under the Link Binary With Libraries section, remove the libEnx.a and add it again

Android Installation

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.rnenxrtc.EnxRtcPackage; to the imports at the top of the file
  • Add new EnxRtcPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:

    include ':enx-rtc-react-native'
    project(':enx-rtc-react-native').projectDir = new File(rootProject.projectDir, 	'../node_modules/enx-rtc-react-native/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:

      compile project(':enx-rtc-react-native')
    
  3. Add following permisions in Android Manifest file:

     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
     <uses-permission android:name="android.permission.CAMERA" />
     <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
     <uses-permission android:name="android.permission.RECORD_AUDIO" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.BLUETOOTH" />
     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    

Usage

import Enx from 'enx-rtc-react-native';

// TODO: What to do with the module?
Enx;
You can’t perform that action at this time.