Skip to content

Commit ef55791

Browse files
aniravi24fabriziomoscon
authored andcommitted
readme updates for RN 0.60 autolink
1 parent 557ef84 commit ef55791

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

README.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# react-native-twilio-programmable-voice
2-
This is a React Native wrapper for Twilio Programmable Voice SDK that lets you make and receive calls from your ReactNatvie App. This module is not curated nor maintained, but inspired by Twilio.
2+
3+
This is a React Native wrapper for Twilio Programmable Voice SDK that lets you make and receive calls from your React Native App. This module is not affiliated with or maintained by the Twilio team. This is maintained by contributions from the community.
34

45
# Twilio Programmable Voice SDK
56

@@ -8,7 +9,9 @@ This is a React Native wrapper for Twilio Programmable Voice SDK that lets you m
89

910
## Breaking changes in v4.0.0
1011

11-
- Android: remove the following block from your application's `AndroidManifest.xml`
12+
It 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
13+
14+
Android: update Firebase Messaging to 17.3.4. Remove the following block from your application's `AndroidManifest.xml`
1215
```xml
1316
<!-- [START instanceId_listener] -->
1417
<service
@@ -21,6 +24,8 @@ This is a React Native wrapper for Twilio Programmable Voice SDK that lets you m
2124
<!-- [END instanceId_listener] -->
2225
```
2326

27+
Android X is supported.
28+
2429
Data passed to the event `deviceDidReceiveIncoming` does not contain the key `call_state`, because state of Call Invites was removed in Twilio Android v3.0.0
2530

2631
- iOS: params changes for `connectionDidConnect` and `connectionDidDisconnect`
@@ -57,7 +62,9 @@ ReactNative success is directly linked to its module ecosystem. One way to make
5762
## Installation
5863

5964
Before starting, we recommend you get familiar with [Twilio Programmable Voice SDK](https://www.twilio.com/docs/api/voice-sdk).
60-
It's easier to integrate this module into your react-native app if you follow the Quick start tutorial from Twilio, because it makes very clear which setup steps are required.
65+
It's easier to integrate this module into your react-native app if you follow the Quick start tutorial from Twilio, because it makes very clear which setup steps are required. On RN 0.60+, this module can be auto-linked (Android still requires FCM setup below).
66+
67+
### Manual Linking
6168

6269

6370
```
@@ -140,8 +147,9 @@ buildscript {
140147
141148
dependencies {
142149
...
150+
// on React Native 0.60+, this module can be auto-linked and doesn't need a manual entry here
143151
144-
compile project(':react-native-twilio-programmable-voice')
152+
implementation project(':react-native-twilio-programmable-voice')
145153
}
146154
147155
// this plugin looks for google-services.json in your project
@@ -168,22 +176,12 @@ In your `AndroidManifest.xml`
168176
</intent-filter>
169177
</service>
170178
<!-- [END fcm_listener] -->
171-
<!-- [START instanceId_listener] -->
172-
<service
173-
android:name="com.hoxfon.react.RNTwilioVoice.fcm.VoiceFirebaseInstanceIDService"
174-
android:exported="false">
175-
<intent-filter>
176-
<action android:name="com.google.android.gms.iid.InstanceID" />
177-
</intent-filter>
178-
</service>
179-
<!-- [END instanceId_listener] -->
180-
<!-- Twilio Voice -->
181179

182180
.....
183181

184182
```
185183

186-
In `android/settings.gradle`
184+
In `android/settings.gradle` (not necessary if auto-linking on RN 0.60+)
187185

188186
```gradle
189187
...
@@ -192,7 +190,7 @@ include ':react-native-twilio-programmable-voice'
192190
project(':react-native-twilio-programmable-voice').projectDir = file('../node_modules/react-native-twilio-programmable-voice/android')
193191
```
194192

195-
Register module (in `MainApplication.java`)
193+
Register module (in `MainApplication.java`) (not necessary if auto-linking on RN 0.60+ unless you want to control microphone permission)
196194

197195
```java
198196
import com.hoxfon.react.RNTwilioVoice.TwilioVoicePackage; // <--- Import Package

android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,7 @@ private void handleIncomingCallIntent(Intent intent) {
464464
WritableMap params = Arguments.createMap();
465465
params.putString("call_sid", activeCallInvite.getCallSid());
466466
params.putString("call_from", activeCallInvite.getFrom());
467-
params.putString("call_to", activeCallInvite.getTo()); // this is not needed
468-
// TODO check if this is needed
469-
// params.putString("call_state", "PENDING");
467+
params.putString("call_to", activeCallInvite.getTo()); // TODO check if needed
470468
eventManager.sendEvent(EVENT_DEVICE_DID_RECEIVE_INCOMING, params);
471469
}
472470
} else {

0 commit comments

Comments
 (0)