Skip to content

Commit

Permalink
Update React Native
Browse files Browse the repository at this point in the history
  • Loading branch information
John Riordan committed Jun 11, 2020
1 parent 185d128 commit 53fd6db
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 694 deletions.
29 changes: 29 additions & 0 deletions docs/react-native.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# React Native


### SimpleUser class

The [SimpleUser](./simple-user.md) class will not work with React Native (it depends on the DOM).

### API framework

In order to use the [API](./api.md) framework in React Native (for building Android and iOS apps):

- include the [react-native-webrtc](https://github.com/react-native-webrtc/react-native-webrtc) dependency into your React Native project
- call the exposed [registerGlobals()](https://github.com/react-native-webrtc/react-native-webrtc#registerglobals) function before creating a new `UserAgent` instance

By calling `registerGlobals()`, classes required by WebRTC such as `RTCPeerConnection` and `MediaStream` (among others) will be exposed in the global scope which is required by the default WebRTC [SessionDescriptionHandler](./session-description-handler).

For example...
```
import { registerGlobals } from 'react-native-webrtc';
import { UserAgent } from 'sip.js';
registerGlobals();
const ua = new UserAgent(/* configuration options here */);
```

### Core library

The [Core](./core.md) library works with React Native out of the box.
1 change: 1 addition & 0 deletions src/platform/react/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See [documentation](../.././../docs/react-native.md).
1 change: 0 additions & 1 deletion src/platform/react/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/platform/react/react-native-webrtc.d.ts

This file was deleted.

Loading

0 comments on commit 53fd6db

Please sign in to comment.