Skip to content

Commit f034ce5

Browse files
doc: migration to v5
1 parent 354cd86 commit f034ce5

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,66 @@ Allow Android to use the built in Android telephony service to make and receive
5353
- Android 4.5.0
5454
- iOS 5.2.0
5555

56+
57+
### Breaking changes in v5.0.0
58+
59+
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 ...
60+
61+
- when the app is not in foreground incoming calls result in a heads-up notification with action to "ACCEPT" and "REJECT"
62+
- ReactMethod `accept` does not dispatch any event. Previously it would dispatch `connectionDidDisconnect`
63+
- ReactMethod `reject` dispatch a `callInviteCancelled` event instead of `connectionDidDisconnect`
64+
- ReactMethod `ignore` does not dispatch any event. Previously it would dispatch `connectionDidDisconnect`
65+
66+
To allow the library to show heads up notifications you must add the following lines to your application `android/app/src/main/AndroidManifest.xml`:
67+
68+
```xml
69+
<!-- receive calls when the app is in the background-->
70+
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
71+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
72+
73+
<application
74+
...
75+
>
76+
<service
77+
android:enabled="true"
78+
android:name="com.hoxfon.react.RNTwilioVoice.IncomingCallNotificationService">
79+
<intent-filter>
80+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_ACCEPT" />
81+
<action android:name="com.hoxfon.react.RNTwilioVoice.ACTION_REJECT" />
82+
</intent-filter>
83+
</service>
84+
...
85+
</application>
86+
```
87+
88+
### ICE
89+
90+
See https://www.twilio.com/docs/stun-turn
91+
92+
```bash
93+
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACb0b56ae3bf07ce4045620249c3c90b40/Tokens.json \
94+
-u ACb0b56ae3bf07ce4045620249c3c90b40:f5c84f06e5c02b55fa61696244a17c84
95+
```
96+
97+
```java
98+
Set<IceServer> iceServers = new HashSet<>();
99+
// server URLs returned by calling the Twilio Rest API to generate a new token
100+
iceServers.add(new IceServer("stun:global.stun.twilio.com:3478?transport=udp"));
101+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=udp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
102+
iceServers.add(new IceServer("turn:global.turn.twilio.com:3478?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
103+
iceServers.add(new IceServer("turn:global.turn.twilio.com:443?transport=tcp","8e6467be547b969ad913f7bdcfb73e411b35f648bd19f2c1cb4161b4d4a067be","n8zwmkgjIOphHN93L/aQxnkUp1xJwrZVLKc/RXL0ZpM="));
104+
105+
IceOptions iceOptions = new IceOptions.Builder()
106+
.iceServers(iceServers)
107+
.build();
108+
109+
ConnectOptions connectOptions = new ConnectOptions.Builder(accessToken)
110+
.iceOptions(iceOptions)
111+
.enableDscp(true)
112+
.params(twiMLParams)
113+
.build();
114+
```
115+
56116
### Breaking changes in v4.0.0
57117

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