Skip to content

Commit c31506a

Browse files
feat: Android v5.4.2
1 parent 4981b13 commit c31506a

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Tested with:
1616

1717
The most updated branch is [feat/twilio-android-sdk-5](https://github.com/hoxfon/react-native-twilio-programmable-voice/tree/feat/twilio-android-sdk-5) which is aligned with:
1818

19-
- Android 5.3.1
19+
- Android 5.4.2
2020
- iOS 5.2.0
2121

2222
It contains breaking changes from `react-native-twilio-programmable-voice` v4, and it will be released as v5.
@@ -175,6 +175,10 @@ getSelectedAudioDevice()
175175
selectAudioDevice(name: string)
176176
```
177177

178+
#### Event deviceDidReceiveIncoming
179+
180+
When a call invite is received, the [SHAKEN/STIR](https://www.twilio.com/docs/voice/trusted-calling-using-shakenstir) `caller_verification` field has been added to the list of params for `deviceDidReceiveIncoming`. Values are: `verified`, `unverified`, `unknown`.
181+
178182
## ICE
179183

180184
See https://www.twilio.com/docs/stun-turn

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies {
5757

5858
implementation fileTree(include: ['*.jar'], dir: 'libs')
5959
implementation 'com.twilio:audioswitch:1.1.2'
60-
implementation 'com.twilio:voice-android:5.3.1'
60+
implementation 'com.twilio:voice-android:5.4.2'
6161
implementation "com.android.support:appcompat-v7:$supportLibVersion"
6262
implementation 'com.facebook.react:react-native:+'
6363
implementation 'com.google.firebase:firebase-messaging:19.0.+'

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ public class Constants {
3636
public static final String CALL_INVITE_KEY = "callInvite";
3737
public static final String CALL_STATE_CONNECTED = Call.State.CONNECTED.toString();
3838
public static final String SELECTED_AUDIO_DEVICE = "selected_audio_device";
39+
public static final String CALLER_VERIFICATION_STATUS = "caller_verification";
40+
public static final String CALLER_VERIFICATION_VERIFIED = "verified";
41+
public static final String CALLER_VERIFICATION_UNVERIFIED = "unverified";
42+
public static final String CALLER_VERIFICATION_UNKNOWN = "unknown";
3943
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,14 @@ private void handleCallInviteNotification() {
578578
params.putString(Constants.CALL_SID, activeCallInvite.getCallSid());
579579
params.putString(Constants.CALL_FROM, activeCallInvite.getFrom());
580580
params.putString(Constants.CALL_TO, activeCallInvite.getTo());
581+
String verificationStatus = Constants.CALLER_VERIFICATION_UNKNOWN;
582+
if (activeCallInvite.getCallerInfo().isVerified() != null) {
583+
verificationStatus = activeCallInvite.getCallerInfo().isVerified() == true
584+
? Constants.CALLER_VERIFICATION_VERIFIED
585+
: Constants.CALLER_VERIFICATION_UNVERIFIED
586+
;
587+
}
588+
params.putString(Constants.CALLER_VERIFICATION_STATUS, verificationStatus);
581589
eventManager.sendEvent(EVENT_DEVICE_DID_RECEIVE_INCOMING, params);
582590
}
583591

0 commit comments

Comments
 (0)