Skip to content

Commit d2df284

Browse files
authored
[Calling][Release] 1.8.0 (#42)
1 parent dcbdc7a commit d2df284

File tree

8 files changed

+162
-96
lines changed

8 files changed

+162
-96
lines changed

demo/App.tsx

Lines changed: 81 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ const App = () => {
4444
const [modalVisible, setModalVisible] = useState(false);
4545
const [selectedLanguage, setSelectedLanguage] = useState('en');
4646
const [isGroupCall, setIsGroupCall] = useState(true);
47+
const [isTeamsCall, setIsTeamsCall] = useState(false);
48+
const [isOneToNCall, setIsOneToNCall] = useState(false);
4749
const [localesArray, setLocalesArray] = useState([]);
4850
const toggleIsRightToLeftSwitch = () => onChangeIsRightToLeft(!isRightToLeft);
4951
const disableLeaveCallConfirmationSwitch = () => onChangeDisableLeaveCallConfirmation(!disableLeaveCallConfirmation);
@@ -130,7 +132,23 @@ const App = () => {
130132

131133
const changeCallMeetingOption = () => {
132134
onChangeMeetingInput('')
133-
setIsGroupCall(!isGroupCall)
135+
setIsGroupCall(true)
136+
setIsTeamsCall(false)
137+
setIsOneToNCall(false)
138+
};
139+
140+
const changeCallTeamsMeetingOption = () => {
141+
onChangeMeetingInput('')
142+
setIsGroupCall(false)
143+
setIsTeamsCall(true)
144+
setIsOneToNCall(false)
145+
};
146+
147+
const changeCallOneToNMeetingOption = () => {
148+
onChangeMeetingInput('')
149+
setIsGroupCall(false)
150+
setIsTeamsCall(false)
151+
setIsOneToNCall(true)
134152
};
135153

136154
return (
@@ -145,45 +163,72 @@ const App = () => {
145163
<Text style={!isGroupCall ? styles.textCloseStyle : styles.textStyle}>Group Call</Text>
146164
</Pressable>
147165
<Pressable
148-
style={[styles.tabButton, !isGroupCall ? styles.buttonOpen : styles.buttonDisabled]}
149-
disabled={!isGroupCall}
150-
onPress={changeCallMeetingOption}
166+
style={[styles.tabButton, isTeamsCall ? styles.buttonOpen : styles.buttonDisabled]}
167+
disabled={isTeamsCall}
168+
onPress={changeCallTeamsMeetingOption}
169+
>
170+
<Text style={!isTeamsCall ? styles.textCloseStyle : styles.textStyle}>Teams Meeting</Text>
171+
</Pressable>
172+
<Pressable
173+
style={[styles.tabButton, isOneToNCall ? styles.buttonOpen : styles.buttonDisabled]}
174+
disabled={isOneToNCall}
175+
onPress={changeCallOneToNMeetingOption}
151176
>
152-
<Text style={isGroupCall ? styles.textCloseStyle : styles.textStyle}>Teams Meeting</Text>
177+
<Text style={!isOneToNCall ? styles.textCloseStyle : styles.textStyle}>One To N Call</Text>
153178
</Pressable>
154179
</View>
155180

156-
{isGroupCall ? <View>
157-
<Text style={styles.inputTitle}>
158-
Group call ID
159-
</Text>
160-
<TextInput
161-
style={styles.textInput}
162-
onChangeText={onChangeMeetingInput}
163-
value={meetingInput}
164-
placeholderTextColor={"#6E6E6E"}
165-
placeholder="Enter call ID"
166-
/>
167-
168-
<Text style={styles.inputDescription}>
169-
Start a call to get a call ID.
170-
</Text>
171-
</View> : <View>
172-
<Text style={styles.inputTitle}>
173-
Teams meeting
174-
</Text>
175-
<TextInput
176-
style={styles.textInput}
177-
onChangeText={onChangeMeetingInput}
178-
value={meetingInput}
179-
placeholderTextColor={"#6E6E6E"}
180-
placeholder="Enter invite link"
181-
/>
182-
183-
<Text style={styles.inputDescription}>
184-
Get link from the meeting invite or anyone in the call.
185-
</Text>
186-
</View>}
181+
{isGroupCall && (
182+
<View>
183+
<Text style={styles.inputTitle}>
184+
Group call ID
185+
</Text>
186+
<TextInput
187+
style={styles.textInput}
188+
onChangeText={onChangeMeetingInput}
189+
value={meetingInput}
190+
placeholderTextColor={"#6E6E6E"}
191+
placeholder="Enter call ID"
192+
/>
193+
<Text style={styles.inputDescription}>
194+
Start a call to get a call ID.
195+
</Text>
196+
</View>
197+
)}
198+
{isTeamsCall && (
199+
<View>
200+
<Text style={styles.inputTitle}>
201+
Teams meeting
202+
</Text>
203+
<TextInput
204+
style={styles.textInput}
205+
onChangeText={onChangeMeetingInput}
206+
value={meetingInput}
207+
placeholderTextColor={"#6E6E6E"}
208+
placeholder="Enter invite link"
209+
/>
210+
<Text style={styles.inputDescription}>
211+
Get link from the meeting invite or anyone in the call.
212+
</Text>
213+
</View>
214+
)}
215+
{isOneToNCall && (
216+
<View>
217+
<Text style={styles.inputTitle}>
218+
One-to-N call
219+
</Text>
220+
<TextInput
221+
style={styles.textInput}
222+
onChangeText={onChangeMeetingInput}
223+
value={meetingInput}
224+
placeholderTextColor={"#6E6E6E"}
225+
placeholder="Enter participants MRIs separated by comma"
226+
/>
227+
<Text style={styles.inputDescription}>
228+
Outgoing Call.
229+
</Text>
230+
</View>
231+
)}
187232

188233
<Text style={styles.inputTitle}>
189234
ACS Token

demo/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ repositories {
119119
}
120120

121121
dependencies {
122-
implementation 'com.azure.android:azure-communication-ui-calling:1.7.0'
122+
implementation 'com.azure.android:azure-communication-ui-calling:1.8.0'
123123
// The version of react-native is set by the React Native Gradle Plugin
124124
implementation("com.facebook.react:react-android")
125125

demo/android/app/src/main/java/com/demo/RNAzureCommunicationUICalling.java

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
import com.azure.android.communication.ui.calling.models.CallCompositeAudioVideoMode;
1818
import com.azure.android.communication.ui.calling.models.CallCompositeCallHistoryRecord;
1919
import com.azure.android.communication.ui.calling.models.CallCompositeDebugInfo;
20-
import com.azure.android.communication.ui.calling.models.CallCompositeDismissedEvent;
2120
import com.azure.android.communication.ui.calling.models.CallCompositeGroupCallLocator;
2221
import com.azure.android.communication.ui.calling.models.CallCompositeJoinLocator;
2322
import com.azure.android.communication.ui.calling.models.CallCompositeLocalOptions;
2423
import com.azure.android.communication.ui.calling.models.CallCompositeLocalizationOptions;
2524
import com.azure.android.communication.ui.calling.models.CallCompositeMultitaskingOptions;
2625
import com.azure.android.communication.ui.calling.models.CallCompositeParticipantViewData;
2726
import com.azure.android.communication.ui.calling.models.CallCompositeSetupScreenViewData;
28-
import com.azure.android.communication.ui.calling.models.CallCompositeRemoteOptions;
2927
import com.azure.android.communication.ui.calling.models.CallCompositeCallScreenControlBarOptions;
3028
import com.azure.android.communication.ui.calling.models.CallCompositeCallScreenOptions;
3129
import com.azure.android.communication.ui.calling.models.CallCompositeSupportedLocale;
@@ -49,7 +47,6 @@
4947
import java.util.ArrayList;
5048
import java.util.List;
5149
import java.util.Locale;
52-
import java.util.Random;
5350
import java.util.UUID;
5451

5552
import okhttp3.OkHttpClient;
@@ -177,21 +174,23 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
177174

178175
CallCompositeCallScreenOptions callScreenOptions = new CallCompositeCallScreenOptions();
179176
callScreenOptions.setControlBarOptions(callScreenControlBarOptions);
180-
181-
CallComposite callComposite = new CallCompositeBuilder()
182-
.localization(new CallCompositeLocalizationOptions(Locale.forLanguageTag(selectedLanguage), layoutDirection))
183-
.setupScreenOrientation(getCompositeDefinedOrientation(setupOrientation))
184-
.callScreenOrientation(getCompositeDefinedOrientation(callOrientation))
185-
.multitasking(new CallCompositeMultitaskingOptions(true))
186-
.callScreenOptions(callScreenOptions)
187-
.build();
188-
177+
189178
try {
190179
CommunicationTokenRefreshOptions communicationTokenRefreshOptions =
191180
new CommunicationTokenRefreshOptions(this::fetchToken, true);
192181

193182
CommunicationTokenCredential communicationTokenCredential = new CommunicationTokenCredential(communicationTokenRefreshOptions);
194183

184+
CallComposite callComposite = new CallCompositeBuilder()
185+
.localization(new CallCompositeLocalizationOptions(Locale.forLanguageTag(selectedLanguage), layoutDirection))
186+
.setupScreenOrientation(getCompositeDefinedOrientation(setupOrientation))
187+
.callScreenOrientation(getCompositeDefinedOrientation(callOrientation))
188+
.multitasking(new CallCompositeMultitaskingOptions(true))
189+
.callScreenOptions(callScreenOptions)
190+
.applicationContext(context.getApplicationContext())
191+
.credential(communicationTokenCredential)
192+
.displayName(displayName)
193+
.build();
195194
callComposite.addOnErrorEventHandler(eventHandler -> {
196195
Log.d(TAG, "================= application is logging exception =================");
197196
Log.d(TAG, eventHandler.getCause().toString());
@@ -237,17 +236,12 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
237236

238237
callComposite.addOnDismissedEventHandler((dismissedEvent) -> {
239238
Log.d(TAG, "================= application is logging call composite dismissed =================");
239+
callComposite.dismiss();
240240
});
241241

242242
if (URLUtil.isValidUrl(meetingInput.trim())) {
243243
CallCompositeJoinLocator locator = new CallCompositeTeamsMeetingLinkLocator(meetingInput);
244244

245-
CallCompositeRemoteOptions remoteOptions = new CallCompositeRemoteOptions(
246-
locator,
247-
communicationTokenCredential,
248-
displayName);
249-
250-
251245
CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions();
252246

253247
if (localAvatarImageResource != null) {
@@ -268,15 +262,17 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
268262
}
269263
localOptions.setAudioVideoMode(CallCompositeAudioVideoMode.AUDIO_ONLY);
270264

271-
callComposite.launch(context, remoteOptions, localOptions);
265+
callComposite.launch(context, locator, localOptions);
272266

273267
} else {
274-
CallCompositeJoinLocator locator = new CallCompositeGroupCallLocator(UUID.fromString(meetingInput));
268+
boolean isUUID = false;
269+
270+
try {
271+
UUID uuid = UUID.fromString(meetingInput);
272+
isUUID = true;
273+
} catch(Exception ignored) {
274+
}
275275

276-
CallCompositeRemoteOptions remoteOptions = new CallCompositeRemoteOptions(
277-
locator,
278-
communicationTokenCredential,
279-
displayName);
280276
CallCompositeLocalOptions localOptions = new CallCompositeLocalOptions();
281277

282278
if (localAvatarImageResource != null) {
@@ -290,15 +286,26 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
290286
localOptions.setParticipantViewData(participantViewData);
291287

292288
}
293-
294289
if (title != null) {
295290
CallCompositeSetupScreenViewData setupViewData = new CallCompositeSetupScreenViewData()
296-
.setTitle(title)
297-
.setSubtitle(subtitle);
291+
.setTitle(title)
292+
.setSubtitle(subtitle);
298293
localOptions.setSetupScreenViewData(setupViewData);
299294
}
300-
301-
callComposite.launch(context, remoteOptions, localOptions);
295+
if (isUUID) {
296+
CallCompositeJoinLocator locator = new CallCompositeGroupCallLocator(UUID.fromString(meetingInput));
297+
callComposite.launch(context, locator, localOptions);
298+
} else {
299+
List<CommunicationIdentifier> identifiers = new ArrayList<>();
300+
String[] rawIdArray = meetingInput.split(",");
301+
for (String rawId : rawIdArray) {
302+
rawId = rawId.trim();
303+
if (!rawId.isEmpty()) {
304+
identifiers.add(CommunicationIdentifier.fromRawId(rawId));
305+
}
306+
}
307+
callComposite.launch(context, identifiers, localOptions);
308+
}
302309
}
303310

304311
promise.resolve(null);

demo/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
buildscript {
44
ext {
55
buildToolsVersion = "33.0.0"
6-
minSdkVersion = 21
6+
minSdkVersion = 26
77
compileSdkVersion = 33
88
targetSdkVersion = 33
99

demo/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ end
2727

2828
target 'demo' do
2929
use_frameworks!
30-
pod 'AzureCommunicationUICalling', '1.7.0'
30+
pod 'AzureCommunicationUICalling', '1.8.0'
3131
config = use_native_modules!
3232

3333
# Flags change depending on the env values.

demo/ios/Podfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- AzureCommunicationCalling (2.10.1):
2+
- AzureCommunicationCalling (2.11.0):
33
- AzureCommunicationCommon (~> 1.0)
44
- AzureCommunicationCommon (1.2.0)
5-
- AzureCommunicationUICalling (1.7.0):
6-
- AzureCommunicationCalling (= 2.10.1)
5+
- AzureCommunicationUICalling (1.8.0):
6+
- AzureCommunicationCalling (= 2.11.0)
77
- AzureCore (= 1.0.0-beta.15)
88
- MicrosoftFluentUI/ActivityIndicator_ios (= 0.10.0)
99
- MicrosoftFluentUI/Avatar_ios (= 0.10.0)
@@ -485,7 +485,7 @@ PODS:
485485
- Yoga (1.14.0)
486486

487487
DEPENDENCIES:
488-
- AzureCommunicationUICalling (= 1.7.0)
488+
- AzureCommunicationUICalling (= 1.8.0)
489489
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
490490
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
491491
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
@@ -629,9 +629,9 @@ EXTERNAL SOURCES:
629629
:path: "../node_modules/react-native/ReactCommon/yoga"
630630

631631
SPEC CHECKSUMS:
632-
AzureCommunicationCalling: 708e0c83cb82b90b42d1e66f8f3ddfc84b7fadc6
632+
AzureCommunicationCalling: 35bebb366c5d423bacdd43550df35c9d89d25235
633633
AzureCommunicationCommon: 130a21be2be889f83dc4adbf994af6285f962de8
634-
AzureCommunicationUICalling: 3796244f7ecf4b8fa992095d6a85a4f6d8e85235
634+
AzureCommunicationUICalling: 9f2151de8c0c0f85cbf6e7a01519608d596034a2
635635
AzureCore: ebbf7cf4dfe72afc7584088c38d1c99f5a35d647
636636
boost: 7dcd2de282d72e344012f7d6564d024930a6a440
637637
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
@@ -680,6 +680,6 @@ SPEC CHECKSUMS:
680680
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
681681
Yoga: c32e0be1a17f8f1f0e633a3122f7666441f52c82
682682

683-
PODFILE CHECKSUM: 4946594670a680345c86dfe67135c3bce62d649a
683+
PODFILE CHECKSUM: c9c5eb9f72d6f83c75fe7b41c95d74b24d0d393e
684684

685685
COCOAPODS: 1.15.2

0 commit comments

Comments
 (0)