Skip to content

Commit fcbf160

Browse files
doc: migration to v5
1 parent d89863a commit fcbf160

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

README.md

+59-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,67 @@ This is a React-Native wrapper for [Twilio Programmable Voice SDK](https://www.t
44

55
## Twilio Programmable Voice SDK
66

7-
- Android 5.0.0 (bundled within the module)
7+
- Android 5.0.2 (bundled within the module)
88
- iOS 5.1.0 (specified by the app's own podfile)
99

10+
## Breaking changes in v5.0.0
11+
12+
Changes on [Android Twilio Voice SDK v5](https://www.twilio.com/docs/voice/voip-sdk/android/3x-changelog#500) are reflected in the JavaScript API, the way call invites are handled and ...
13+
14+
- when the app is not in foreground incoming calls result in a heads-up notification with action to "ACCEPT" and "REJECT"
15+
- ReactMethod `accept` does not dispatch any event. Previously it would dispatch `connectionDidDisconnect`
16+
- ReactMethod `reject` dispatch a `callInviteCancelled` event instead of `connectionDidDisconnect`
17+
- ReactMethod `ignore` does not dispatch any event. Previously it would dispatch `connectionDidDisconnect`
18+
19+
To allow the library to show heads up notifications you must add the following lines to your application `android/app/src/main/AndroidManifest.xml`:
20+
21+
```xml
22+
<!-- receive calls when the app is in the background-->
23+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
24+
25+
<application
26+
...
27+
>
28+
<service
29+
android:enabled="true"
30+
android:name="com.hoxfon.react.RNTwilioVoice.IncomingCallNotificationService">
31+
<intent-filter>
32+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_ACCEPT" />
33+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_REJECT" />
34+
</intent-filter>
35+
</service>
36+
...
37+
</application>
38+
```
39+
40+
## ICE
41+
42+
See https://www.twilio.com/docs/stun-turn
43+
44+
```bash
45+
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACb0b56ae3bf07ce4045620249c3c90b40/Tokens.json \
46+
-u ACb0b56ae3bf07ce4045620249c3c90b40:f5c84f06e5c02b55fa61696244a17c84
47+
```
48+
49+
```java
50+
Set<IceServer> iceServers = new HashSet<>();
51+
// server URLs returned by calling the Twilio Rest API to generate a new token
52+
iceServers.add(new IceServer("stun:global.stun.twilio.com:3478?transport=udp"));
53+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=udp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
54+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
55+
iceServers.add(new IceServer("turn:global.turn.twilio.com:443?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
56+
57+
IceOptions iceOptions = new IceOptions.Builder()
58+
.iceServers(iceServers)
59+
.build();
60+
61+
ConnectOptions connectOptions = new ConnectOptions.Builder(accessToken)
62+
.iceOptions(iceOptions)
63+
.enableDscp(true)
64+
.params(twiMLParams)
65+
.build();
66+
```
67+
1068
## Breaking changes in v4.0.0
1169

1270
The module implements [react-native autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) as many other native libraries > react-native 0.60.0, therefore it doesn't need to be linked manually.

0 commit comments

Comments
 (0)