Skip to content

Commit b1ba68f

Browse files
doc: migration to v5
1 parent 3b2733b commit b1ba68f

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

README.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,68 @@ 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.USE_FULL_SCREEN_INTENT" />
24+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
25+
26+
<application
27+
...
28+
>
29+
<service
30+
android:enabled="true"
31+
android:name="com.hoxfon.react.RNTwilioVoice.IncomingCallNotificationService">
32+
<intent-filter>
33+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_ACCEPT" />
34+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_REJECT" />
35+
</intent-filter>
36+
</service>
37+
...
38+
</application>
39+
```
40+
41+
## ICE
42+
43+
See https://www.twilio.com/docs/stun-turn
44+
45+
```bash
46+
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACb0b56ae3bf07ce4045620249c3c90b40/Tokens.json \
47+
-u ACb0b56ae3bf07ce4045620249c3c90b40:f5c84f06e5c02b55fa61696244a17c84
48+
```
49+
50+
```java
51+
Set<IceServer> iceServers = new HashSet<>();
52+
// server URLs returned by calling the Twilio Rest API to generate a new token
53+
iceServers.add(new IceServer("stun:global.stun.twilio.com:3478?transport=udp"));
54+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=udp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
55+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
56+
iceServers.add(new IceServer("turn:global.turn.twilio.com:443?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
57+
58+
IceOptions iceOptions = new IceOptions.Builder()
59+
.iceServers(iceServers)
60+
.build();
61+
62+
ConnectOptions connectOptions = new ConnectOptions.Builder(accessToken)
63+
.iceOptions(iceOptions)
64+
.enableDscp(true)
65+
.params(twiMLParams)
66+
.build();
67+
```
68+
1069
## Breaking changes in v4.0.0
1170

1271
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)