diff --git a/README.md b/README.md index 28dd1c8d..bf13eee5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Tested with: 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: -- Android 5.3.1 +- Android 5.4.2 - iOS 5.2.0 It contains breaking changes from `react-native-twilio-programmable-voice` v4, and it will be released as v5. @@ -175,6 +175,10 @@ getSelectedAudioDevice() selectAudioDevice(name: string) ``` +#### Event deviceDidReceiveIncoming + +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`. + ## ICE See https://www.twilio.com/docs/stun-turn diff --git a/android/build.gradle b/android/build.gradle index 0e37a582..c750e6d4 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -57,7 +57,7 @@ dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.twilio:audioswitch:1.1.2' - implementation 'com.twilio:voice-android:5.3.1' + implementation 'com.twilio:voice-android:5.4.2' implementation "com.android.support:appcompat-v7:$supportLibVersion" implementation 'com.facebook.react:react-native:+' implementation 'com.google.firebase:firebase-messaging:19.0.+' diff --git a/android/src/main/java/com/hoxfon/react/RNTwilioVoice/Constants.java b/android/src/main/java/com/hoxfon/react/RNTwilioVoice/Constants.java index fdf77e10..2a9a137a 100644 --- a/android/src/main/java/com/hoxfon/react/RNTwilioVoice/Constants.java +++ b/android/src/main/java/com/hoxfon/react/RNTwilioVoice/Constants.java @@ -36,4 +36,8 @@ public class Constants { public static final String CALL_INVITE_KEY = "callInvite"; public static final String CALL_STATE_CONNECTED = Call.State.CONNECTED.toString(); public static final String SELECTED_AUDIO_DEVICE = "selected_audio_device"; + public static final String CALLER_VERIFICATION_STATUS = "caller_verification"; + public static final String CALLER_VERIFICATION_VERIFIED = "verified"; + public static final String CALLER_VERIFICATION_UNVERIFIED = "unverified"; + public static final String CALLER_VERIFICATION_UNKNOWN = "unknown"; } diff --git a/android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java b/android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java index bea19cae..a08a7b50 100644 --- a/android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java +++ b/android/src/main/java/com/hoxfon/react/RNTwilioVoice/TwilioVoiceModule.java @@ -578,6 +578,14 @@ private void handleCallInviteNotification() { params.putString(Constants.CALL_SID, activeCallInvite.getCallSid()); params.putString(Constants.CALL_FROM, activeCallInvite.getFrom()); params.putString(Constants.CALL_TO, activeCallInvite.getTo()); + String verificationStatus = Constants.CALLER_VERIFICATION_UNKNOWN; + if (activeCallInvite.getCallerInfo().isVerified() != null) { + verificationStatus = activeCallInvite.getCallerInfo().isVerified() == true + ? Constants.CALLER_VERIFICATION_VERIFIED + : Constants.CALLER_VERIFICATION_UNVERIFIED + ; + } + params.putString(Constants.CALLER_VERIFICATION_STATUS, verificationStatus); eventManager.sendEvent(EVENT_DEVICE_DID_RECEIVE_INCOMING, params); }