Skip to content

Commit

Permalink
fix: ts build error
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Nov 17, 2020
1 parent abdf6a2 commit 450ebbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions example/agora.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"appId": YOUR_APP_ID,
"channelId": "APIExample",
"token": YOUR_TOEKN
}
6 changes: 4 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { PermissionsAndroid, StyleSheet, Text, View } from 'react-native';
import AgoraRawdata from 'react-native-agora-rawdata';
import Agora, { RtcLocalView, RtcRemoteView } from 'react-native-agora';

const config = require('../../../agora.config.json');

export default function App() {
const [joined, setJoined] = React.useState<boolean>();

Expand All @@ -12,7 +14,7 @@ export default function App() {
PermissionsAndroid.PERMISSIONS.CAMERA,
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
]);
const agora = await Agora.create(YOUR_APP_ID);
const agora = await Agora.create(config.appId);
agora.addListener('JoinChannelSuccess', () => {
setJoined(true);
});
Expand All @@ -23,7 +25,7 @@ export default function App() {
await AgoraRawdata.registerVideoFrameObserver(
await agora.getNativeHandle()
);
await agora.joinChannel(undefined, '123', undefined, 456);
await agora.joinChannel(config.token, config.channelId, undefined, 456);
};

// eslint-disable-next-line jest/no-disabled-tests
Expand Down

0 comments on commit 450ebbe

Please sign in to comment.