|
15 | 15 | <blockquote> |
16 | 16 | <p>[!NOTE] |
17 | 17 | This is v2 of the React-Native SDK. When migrating from v1.x to v2.x you might encounter a small set of breaking changes. |
18 | | -Read the <a href="https://docs.livekit.io/guides/migrate-from-v1/">migration guide</a> for a detailed overview of what has changed.</p> |
| 18 | +Read the <a href="https://docs.livekit.io/recipes/migrate-from-v1/">migration guide</a> for a detailed overview of what has changed.</p> |
19 | 19 | </blockquote> |
20 | 20 | <a id="md:installation" class="tsd-anchor"></a><h2><a href="#md:installation">Installation</a></h2><a id="md:npm" class="tsd-anchor"></a><h3><a href="#md:npm">NPM</a></h3><pre><code class="language-sh"><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-2">@livekit/react-native</span><span class="hl-1"> </span><span class="hl-2">@livekit/react-native-webrtc</span> |
21 | 21 | </code><button>Copy</button></pre> |
|
70 | 70 | hook is advised over just configuring the audio session once for the entire audio session.</p> |
71 | 71 | <a id="md:screenshare" class="tsd-anchor"></a><h2><a href="#md:screenshare">Screenshare</a></h2><p>Enabling screenshare requires extra installation steps:</p> |
72 | 72 | <a id="md:android-2" class="tsd-anchor"></a><h3><a href="#md:android-2">Android</a></h3><p>Android screenshare requires a foreground service with type <code>mediaProjection</code> to be present.</p> |
73 | | -<p>From version 2.4.0 onwards, the foreground service is handled internally, |
| 73 | +<p>From version 2.4.0 onwards, the foreground service is handled internally, |
74 | 74 | but you must declare the permission yourself in your app's AndroidManifest.xml file.</p> |
75 | 75 | <pre><code><span class="hl-1"><</span><span class="hl-6">uses</span><span class="hl-1">-</span><span class="hl-6">permission</span><span class="hl-1"> </span><span class="hl-13">android</span><span class="hl-1">:</span><span class="hl-6">name</span><span class="hl-1">=</span><span class="hl-2">"android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"</span><span class="hl-1"> /></span> |
76 | 76 | </code><button>Copy</button></pre> |
|
96 | 96 | </code><button>Copy</button></pre> |
97 | 97 | <p>The camera and microphone permissions/foreground service types can be omitted if you are not using those.</p> |
98 | 98 | <p>Once setup, <a href="https://github.com/livekit/client-sdk-react-native/blob/main/example/src/callservice/CallService.android.ts">start the foreground service</a> to keep the app alive in the background.</p> |
99 | | -<a id="md:ios-3" class="tsd-anchor"></a><h3><a href="#md:ios-3">iOS</a></h3><p>By default, simple background processing can be enabled by selecting the <code>audio</code> and <code>voip</code> |
100 | | -<a href="https://developer.apple.com/documentation/bundleresources/information_property_list/uibackgroundmodes">UIBackgroundModes</a> |
| 99 | +<a id="md:ios-3" class="tsd-anchor"></a><h3><a href="#md:ios-3">iOS</a></h3><p>By default, simple background processing can be enabled by selecting the <code>audio</code> and <code>voip</code> |
| 100 | +<a href="https://developer.apple.com/documentation/bundleresources/information_property_list/uibackgroundmodes">UIBackgroundModes</a> |
101 | 101 | in your XCode project. In your project, select your app target -> Signing & Capabilities -> Add Capability -> Background Modes.</p> |
102 | 102 | <p>These background modes will keep the app alive in the background as long as a mic or audio track is playing.</p> |
103 | | -<p>For a more robust background that isn't sensitive to the above conditions, we suggest using |
104 | | -<a href="https://developer.apple.com/documentation/callkit/">CallKit</a> to maintain the |
105 | | -connection while in the background. The example uses |
| 103 | +<p>For a more robust background that isn't sensitive to the above conditions, we suggest using |
| 104 | +<a href="https://developer.apple.com/documentation/callkit/">CallKit</a> to maintain the |
| 105 | +connection while in the background. The example uses |
106 | 106 | <a href="https://github.com/react-native-webrtc/react-native-callkeep">react-native-callkeep</a> |
107 | 107 | for simple integration with CallKit.</p> |
108 | 108 | <p>Our example code can be found <a href="https://github.com/livekit/client-sdk-react-native/blob/main/example/src/callservice/CallService.ios.ts">here</a>.</p> |
|
0 commit comments