You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a ReactNative wrapper for Twilio Programmable Voice SDK that lets you make and receive calls from your ReactNative App. This module is not affiliated with or maintained by the Twilio team. This is maintained by contributions from the community.
3
+
This is a React-Native wrapper for [Twilio Programmable Voice SDK](https://www.twilio.com/voice) which lets you make and receive calls from your React-Native App. This module is not affiliated with nor officially maintained by Twilio, and it is maintained by open source contributors.
4
4
5
-
# Twilio Programmable Voice SDK
5
+
##Twilio Programmable Voice SDK
6
6
7
-
- Android 4.5.0 (bundled within this library)
8
-
- iOS 2.1.0 (specified by the app's own podfile)
7
+
- Android 4.5.0 (bundled within the module)
8
+
- iOS 5.1.0 (specified by the app's own podfile)
9
9
10
10
## Breaking changes in v4.0.0
11
11
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
12
+
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.
13
+
14
+
Android: update Firebase Messaging to 17.6.+. Remove the following block from your application's `AndroidManifest.xml` if you are migrating from v3.
13
15
14
-
Android: update Firebase Messaging to 17.6.+. Remove the following block from your application's `AndroidManifest.xml`
15
16
```xml
16
17
<!-- [START instanceId_listener] -->
17
18
<service
@@ -26,7 +27,7 @@ Android: update Firebase Messaging to 17.6.+. Remove the following block from yo
26
27
27
28
Android X is supported.
28
29
29
-
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
30
+
Data passed to the event `deviceDidReceiveIncoming` does not contain the key `call_state`, because state of Call Invites was removed in Twilio Android and iOS SDK v3.0.0
30
31
31
32
- iOS: params changes for `connectionDidConnect` and `connectionDidDisconnect`
32
33
@@ -44,85 +45,79 @@ You should use `hold()` to put a call on hold.
44
45
45
46
You can be notified when a call is `ringing` by listening for `callStateRinging` events.
46
47
48
+
iOS application can now receive the following events, that in v3 where only dispatched to Android:
49
+
50
+
- deviceDidReceiveIncoming
51
+
- callInviteCancelled
52
+
- callStateRinging
53
+
- connectionIsReconnecting
54
+
- connectionDidReconnect
55
+
47
56
## Breaking changes in v3.0.0
48
57
49
58
- initWitToken returns an object with a property `initialized` instead of `initilized`
50
59
- iOS event `connectionDidConnect` returns the same properties as Android
51
60
move property `to` => `call_to`
52
61
move property `from` => `call_from`
53
62
54
-
## Help wanted!
55
-
56
-
There is no need to ask permissions to contribute. Just open an issue or provide a PR. Everybody is welcome to contribute.
57
-
58
-
ReactNative success is directly linked to its module ecosystem. One way to make an impact is helping contributing to this module or another of the many community lead ones.
Before starting, we recommend you get familiar with [Twilio Programmable Voice SDK](https://www.twilio.com/docs/api/voice-sdk).
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
66
+
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.
react-native link react-native-twilio-programmable-voice
73
70
```
74
71
75
-
### iOS Installation - when projects made with react-native init
76
-
After you have linked the library with `react-native link react-native-twilio-programmable-voice`
77
-
check that `libRNTwilioVoice.a` is present under YOUR_TARGET > Build Phases > Link Binaries With Libraries. If it is not present you can add it using the + sign at the bottom of that list.
72
+
-**React Native 0.60+**
78
73
79
-
Edit your `Podfile` to include TwilioVoice framework
74
+
[CLI autolink feature](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) links the module while building the app.
75
+
76
+
-**React Native <= 0.59**
80
77
78
+
```bash
79
+
react-native link react-native-twilio-programmable-voice
81
80
```
82
-
source 'https://github.com/cocoapods/specs'
83
81
84
-
# min version for TwilioVoice to work
85
-
platform :ios, '10.0'
82
+
### iOS Installation
86
83
87
-
target <YOUR_TARGET> do
88
-
...
89
-
pod 'TwilioVoice', '~> 5.1.1'
90
-
...
91
-
end
84
+
If you can't or don't want to use autolink, you can also manually link the library using the instructions below (click on the arrow to show them):
92
85
93
-
```
86
+
<details>
87
+
<summary>Manually link the library on iOS</summary>
94
88
95
-
run `pod install` from inside your project `ios` directory
89
+
Follow the [instructions in the React Native documentation](https://facebook.github.io/react-native/docs/linking-libraries-ios#manual-linking) to manually link the framework
96
90
97
-
### iOS Installation - when projects made without react-native init
98
-
Edit your `Podfile` to include TwilioVoice and RNTwilioVoice frameworks
91
+
After you have linked the library with `react-native link react-native-twilio-programmable-voice`
92
+
check that `libRNTwilioVoice.a` is present under YOUR_TARGET > Build Phases > Link Binaries With Libraries. If it is not present you can add it using the + sign at the bottom of that list.
93
+
</details>
99
94
100
-
```
95
+
Edit your `Podfile` to include TwilioVoice framework
96
+
97
+
```ruby
101
98
source 'https://github.com/cocoapods/specs'
102
99
103
100
# min version for TwilioVoice to work
104
101
platform :ios, '10.0'
105
102
106
103
target <YOUR_TARGET>do
107
104
...
108
-
pod 'TwilioVoice', '~> 5.1.1'
109
-
pod 'RNTwilioVoice', path: '../node_modules/react-native-twilio-programmable-voice'
105
+
pod 'TwilioVoice', '~> 5.2.0'
110
106
...
111
107
end
112
-
113
108
```
114
109
115
-
run `pod install` from inside your project `ios` directory
116
-
117
-
### CallKit
110
+
```bash
111
+
cd ios/ && pod install
112
+
```
118
113
119
-
The current iOS part of this library works through [CallKit](https://developer.apple.com/reference/callkit). Because of this the call flow is much simpler than on Android as CallKit handles the inbound calls answering, ignoring, or rejecting.
120
-
Because of CallKit, the only event listeners present are "deviceReady", "connectionDidConnect", "connectionDidDisconnect", and "callRejected".
114
+
#### CallKit
121
115
122
-
### VoIP Service Certificate
116
+
The iOS library works through [CallKit](https://developer.apple.com/reference/callkit) and handling calls is much simpler than the Android implementation as CallKit handles the inbound calls answering, ignoring, or rejecting. Outbound calls must be controlled by custom React-Native screens and controls.
123
117
124
-
Twilio Programmable Voice for iOS utilizes Apple's VoIP Services and VoIP "Push Notifications" instead of FCM. You will need a VoIP Service Certificate from Apple to receive calls.
118
+
#### VoIP Service Certificate
125
119
120
+
Twilio Programmable Voice for iOS utilizes Apple's VoIP Services and VoIP "Push Notifications" instead of FCM. You will need a VoIP Service Certificate from Apple to receive calls. Follow [the official Twilio instructions](https://github.com/twilio/voice-quickstart-ios#7-create-voip-service-certificate) to complete this step.
126
121
127
122
## Android Installation
128
123
@@ -131,42 +126,27 @@ Setup FCM
131
126
You must download the file `google-services.json` from the Firebase console.
132
127
It contains keys and settings for all your applications under Firebase. This library obtains the resource `senderID` for registering for remote GCM from that file.
133
128
134
-
**NOTE: To use a specific `play-service-gcm` version, update the `compile` instruction in your App's `android/app/build.gradle` (replace `10.+` with the version you prefer):**
135
-
136
-
```gradle
137
-
...
129
+
#### `android/build.gradle`
138
130
131
+
```groovy
139
132
buildscript {
140
-
...
141
-
dependencies {
142
-
classpath 'com.google.gms:google-services:4.2.0'
143
-
}
144
-
}
145
-
146
-
...
147
-
148
-
dependencies {
149
-
...
150
-
// on React Native 0.60+, this module can be auto-linked and doesn't need a manual entry here
project(':react-native-twilio-programmable-voice').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-twilio-programmable-voice/android')
There is no need to ask permissions to contribute. Just open an issue or provide a PR. Everybody is welcome to contribute.
378
+
379
+
ReactNative success is directly linked to its module ecosystem. One way to make an impact is helping contributing to this module or another of the many community lead ones.
0 commit comments