# enx-uikit-react-native

## Installation:

```bash
    npm install  enx-uikit-react-native
```

## Getting started

## Pre-Requisites:

1. Install [node.js](https://nodejs.org/)

2. Install and update [Xcode](https://developer.apple.com/xcode/) (you will need a Mac)
* React Native iOS installation [instructions](https://reactnative.dev/docs/environment-setup)

3. Install and update [Android Studio](https://developer.android.com/studio/index.html)
* React Native Android installation [instructions](https://reactnative.dev/docs/environment-setup)

4. Visual Studio Code (Recommended to use Latest version).

5. Enablex Developer Account [Sign up] (https://portal.enablex.io/cpaas/trial-sign-up/)

6. Run the following command to install React Native Video SDK

```bash
    npm install  enx-rtc-react-native
```

7. An iOS or Android Device for testing the Application.

8. Basic understanding of React Native development

## Define Device Permissions: You must have camera and microphone premission

#### For Android 

Open the AndroidManifest.xml file and add the required device permissions to the file. 

```
<manifest> 
... 
<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.RECORD_AUDIO" /> 
<uses-permission android:name="android.permission.CAMERA" /> 
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
... 
</manifest>
```

After adding the permission in AndroidManifest.xml file, do code in your app level to show dialog to grant permissions. 

#### For IOS

Go to you project -> iOS folger -> and open the info.plist

add NSCameraUsageDescription and NSMicrophoneUsageDescription. This is needed to add permission into your application.

Now go to your project folder through terminal > iOS > and install POD using the following command:

```
  pod install
```

## Usage

```jsx
import React, { Component } from 'react'

import {EnxVideoView} from 'enx-uikit-react-native'

class Example extends Component {
  render() {
    return(
        <EnxVideoView
            token={Valid EnableX Token}
            onDisconnect = {handle disconnect event}
            connectError = {Handle Room error event}
          />
    ) 
  }
}
```

## For More Information

To know more about UIKIT SDK , [Go To] (https://www.enablex.io/developer/video/solutions/video-ui-kit/react-native-video-uikit/)

## License

MIT © [enablexer](https://github.com/enablexer)
