Code Monkey home page Code Monkey logo

reactnative-uikit's Introduction

Agora UI Kit for React Native

Instantly integrate Agora video calling or streaming into your React Native application.

img

Getting started

Requirements

Expo is now supported using custom-dev-clients, for more information read this blog post

Installation

To a react-native application generated using react-native-cli, add the following:

npm i react-native-agora agora-rn-uikit

Usage

This UIKit is very simple to use and contains a high level component called AgoraUIKit. You can check out code explanation here.

A simple sample app integrating Agora UI Kit:

import React, {useState} from 'react';
import AgoraUIKit from 'agora-rn-uikit';

const App = () => {
  const [videoCall, setVideoCall] = useState(true);
  const rtcProps = {
    appId: '<Agora App ID>',
    channel: 'test',
  };
  const callbacks = {
    EndCall: () => setVideoCall(false),
  };
  return videoCall ? (
    <AgoraUIKit rtcProps={rtcProps} callbacks={callbacks} />
  ) : (
    <Text onPress={()=>setVideoCall(true)}>Start Call</Text>
  );
};

export default App;

Replace the '<Agora App ID>' with your own appID.

If you're using an App ID in secured mode, you'll need to pass in a token (you can generate a temporary token using the Agora console).

Demo Project

There's a React Native UIKit demo here, and one with typescript here.

Instructions for running on Android:

  1. Connect your Android device to system with debugging on 
  2. Type adb devices to verify if the device is connected 
  3. Run npm start – This will start the development server 
  4. Open another terminal in the same folder 
  5. Run npm run android - This will deploy the app on the Android device. (Now, the app will connect our development server)
  6. Note Android simulators are not recommended since they might not be able to access camera and mic.

Instructions for running on iOS:

  1. Connect an IOS device to system, create an apple developer account and register your device with apple for development.
  2. Run npx pod-install to download the necessary pods.
  3. Open the .xcworkspace file located in ios folder using XCode.
  4. Open the info tab and add the following: 
    1. Privacy Camera description - Camera permission
    2. Privacy Microphone description - Mic permission
  5. Configure code signing: https://reactnative.dev/docs/running-on-device#2-configure-code-signing
  6. Run the project by clicking the Run button in Xcode 
  7. Note Simulators won’t work since IOS simulator can’t access camera

Documentation

For full documentation, see our docs page.

You can visit the wiki for other examples and in depth guide.

reactnative-uikit's People

Contributors

dependabot[bot] avatar ekaansharora avatar technophilic avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.