MCPcopy Index your code
hub / github.com/AgoraIO-Extensions/react-native-agora

github.com/AgoraIO-Extensions/react-native-agora @v4.6.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.6.2 ↗ · + Follow
3,406 symbols 6,100 edges 269 files 448 documented · 13%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

⚠️ Note: To provide you with better and higher quality technical support services, we will no longer provide technical support through GitHub issues. If you need help, please contact us directly through Agora Support.

NOTE: These sdk and samples only for the Agora Video 4.x APIs. For examples using previous releases please see the following branches:

react-native-agora

npm npm npm npm

This SDK takes advantage of React Native and Agora RTC Video SDK on Android && iOS.

Community Contributor

The community developer Syanbo developed 1.0 version React Native SDK based on the Agora Native SDK from 2016 to 2017. As the community's demand for React Native SDK keeps growing, Agora has achieved official cooperation with Syanbo, this project now is officially maintained by Agora. Thanks to Syanbo for his long-term contributions to React Native SDK.

Release Note

Changelog

Installation

Installing (React Native >= 0.60.0)

Install react-native-agora(^4.0.0):

```shell script yarn add react-native-agora


or

```shell script
npm i --save react-native-agora

Go to your ios folder and run:

```shell script pod install


## General Usage

```typescript
import { createAgoraRtcEngine } from 'react-native-agora';

const engine = createAgoraRtcEngine();
engine.initialize({ appId: 'YOUR APP ID' });

or

const createAgoraRtcEngine = require('react-native-agora');
const engine = createAgoraRtcEngine();
engine.initialize({ appId: 'YOUR APP ID' });

Using TypeScript

We suggest you use TypeScript to develop, or use TypeScript eslint to lint your code.

Troubleshooting

Pod install failed (React Native >= 0.62.0)

The error log:

[!] The 'xxx' target has libraries with conflicting names: libcrypto.a.

You should disable Flipper, you can found it in the Podfile, and comment the code about Flipper in AppDelegate.

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  add_flipper_pods!
  post_install do |installer|
    flipper_post_install(installer)
  end

RCT_EXTERN_MODULE Swift modules broken in Xcode 10.2

The error log:

Swift class extensions and categories on Swift classes are not allowed to have +load methods

Fixed in React Native 0.59.3.

Source: https://github.com/facebook/react-native/issues/24139

XCode 11 Beta App Launch Crash

The error log:

Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: index 1 beyond bounds [0 .. 0]' was thrown while invoking getCurrentAppState on target AppState with params (
2,
3
)

Fixed in React Native 0.59.9.

Source: https://github.com/facebook/react-native/issues/25154

FOREGROUND_SERVICE_MEDIA_PROJECTION permission

If you are not using screen sharing feature in your app, you should exclude Screen Sharing extension as below:

// build.gradle (project-level)
signingConfigs{
 ....
}

configurations.configureEach {
    exclude group: "io.agora.rtc", module: "full-screen-sharing"
}
compileOptions{
 ...
}

API

Resources

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Extension points exported contracts — how you extend this code

IRtcEngineEventHandler (Interface)
(no doc) [64 implementers]
src/IAgoraRtcEngine.ts
IMediaPlayerSourceObserver (Interface)
(no doc) [8 implementers]
src/IAgoraMediaPlayerSource.ts
IMediaPlayer (Interface)
(no doc) [8 implementers]
src/extension/IAgoraMediaPlayerExtension.ts
IAudioPcmFrameSink (Interface)
(no doc) [4 implementers]
src/AgoraMediaBase.ts
IMediaPlayerVideoFrameObserver (Interface)
(no doc) [4 implementers]
src/IAgoraMediaPlayer.ts
AgoraPipStateChangedObserver (Interface)
(no doc) [2 implementers]
src/IAgoraPip.ts
IMusicContentCenterEventHandler (Interface)
(no doc) [2 implementers]
src/IAgoraMusicContentCenter.ts
Spec (Interface)
(no doc) [2 implementers]
src/specs/NativeAgoraRtcNg.ts

Core symbols most depended-on inside this repo

addListener
called by 130
src/specs/NativeAgoraRtcNg.ts
createAgoraRtcEngine
called by 115
src/index.ts
release
called by 81
src/extension/IAgoraMediaPlayerExtension.ts
removeListener
called by 67
src/extension/IAgoraPipExtension.ts
registerEventHandler
called by 66
src/impl/IAgoraRtcEngineImpl.ts
unregisterEventHandler
called by 64
src/impl/IAgoraRtcEngineImpl.ts
emitEvent
called by 61
src/internal/event.ts
get
called by 60
src/impl/IAgoraMusicContentCenterImpl.ts

Shape

Method 2,267
Class 524
Function 308
Enum 191
Interface 116

Languages

TypeScript95%
Java2%
Kotlin2%

Modules by API surface

src/impl/IAgoraRtcEngineImpl.ts637 symbols
src/AgoraBase.ts273 symbols
src/IAgoraRtcEngine.ts176 symbols
src/impl/IAgoraMediaPlayerImpl.ts139 symbols
src/impl/IAgoraRtcEngineExImpl.ts122 symbols
src/AgoraMediaBase.ts92 symbols
src/impl/IAudioDeviceManagerImpl.ts62 symbols
src/impl/IAgoraMusicContentCenterImpl.ts61 symbols
src/impl/IAgoraSpatialAudioImpl.ts44 symbols
src/impl/IAgoraMediaEngineImpl.ts42 symbols
src/internal/RtcEngineExInternal.ts40 symbols
src/internal/MusicContentCenterInternal.ts36 symbols

For agents

$ claude mcp add react-native-agora \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact