Skip to content

Commit 01430cf

Browse files
authored
[Calling][Release] Calling UI SDK Release 1.4.0 (#30)
1 parent f1f85b4 commit 01430cf

File tree

11 files changed

+2837
-2881
lines changed

11 files changed

+2837
-2881
lines changed

AzureCommunicationUIDemoApp/android/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ dependencies {
200200
//noinspection GradleDynamicVersion
201201
implementation "com.facebook.react:react-native:+" // From node_modules
202202

203-
implementation 'com.azure.android:azure-communication-ui-calling:1.2.0'
203+
implementation 'com.azure.android:azure-communication-ui-calling:1.4.0'
204204

205-
implementation "com.microsoft.fluentui:fluentui_others:0.0.20"
206-
implementation "com.microsoft.fluentui:fluentui_drawer:0.0.20"
207-
implementation "com.microsoft.fluentui:fluentui_persona:0.0.20"
208-
implementation "com.microsoft.fluentui:fluentui_transients:0.0.20"
205+
implementation "com.microsoft.fluentui:fluentui_others:0.0.21"
206+
implementation "com.microsoft.fluentui:fluentui_drawer:0.0.21"
207+
implementation "com.microsoft.fluentui:fluentui_persona:0.0.21"
208+
implementation "com.microsoft.fluentui:fluentui_transients:0.0.21"
209209

210210
implementation ("androidx.appcompat:appcompat:1.4.2") {
211211
version {
212212
strictly '1.4.2'
213213
}
214214
}
215215

216-
implementation 'com.azure.android:azure-communication-calling:2.2.1'
216+
implementation 'com.azure.android:azure-communication-calling:2.5.0'
217217

218218
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10'
219219
implementation 'androidx.core:core-ktx:1.7.0'

AzureCommunicationUIDemoApp/android/app/src/main/java/com/azurecommunicationuidemoapp/RNAzureCommunicationUICalling.java

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class RNAzureCommunicationUICalling extends ReactContextBaseJavaModule {
5252

5353
private static final String TAG = "RNAzureCallingUI";
5454
String mToken = "";
55+
CallComposite callComposite = null;
5556

5657
RNAzureCommunicationUICalling(ReactApplicationContext context) {
5758
super(context);
@@ -62,6 +63,13 @@ public String getName() {
6263
return "RNAzureCommunicationUICalling";
6364
}
6465

66+
@ReactMethod
67+
public void dismiss() {
68+
if (callComposite != null) {
69+
callComposite.dismiss();
70+
}
71+
}
72+
6573
@ReactMethod
6674
public void startCallComposite(ReadableMap localOptions,
6775
ReadableMap localAvatarImageResource,
@@ -98,14 +106,16 @@ public void getSupportedLocales(Promise promise) {
98106
}
99107
promise.resolve(wArr);
100108
}
101-
109+
102110
@ReactMethod
103111
public void addListener(String eventName) {}
104112

105113
@ReactMethod()
106114
public void getDebugInfo(Promise promise) {
107115
WritableArray wArr = Arguments.createArray();
108-
CallComposite callComposite = new CallCompositeBuilder().build();
116+
if (callComposite == null) {
117+
callComposite = new CallCompositeBuilder().build();
118+
}
109119
CallCompositeDebugInfo debugInfo = callComposite.getDebugInfo(getCurrentActivity());
110120
for (CallCompositeCallHistoryRecord record : debugInfo.getCallHistoryRecords()) {
111121
WritableMap recordMap = Arguments.createMap();
@@ -132,7 +142,7 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
132142

133143
int layoutDirection = isRightToLeft ? LayoutDirection.RTL : LayoutDirection.LTR;
134144

135-
CallComposite callComposite = new CallCompositeBuilder()
145+
callComposite = new CallCompositeBuilder()
136146
.localization(new CallCompositeLocalizationOptions(Locale.forLanguageTag(selectedLanguage), layoutDirection)).build();
137147

138148

@@ -167,6 +177,15 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
167177
});
168178
}
169179

180+
callComposite.addOnCallStateChangedEventHandler((callStateChangedEvent) -> {
181+
Log.d(TAG, "================= application is logging call state change =================");
182+
Log.d(TAG, callStateChangedEvent.getCode().toString());
183+
Log.d(TAG, callComposite.getCallState().toString());
184+
});
185+
186+
callComposite.addOnDismissedEventHandler((dismissedEvent) -> {
187+
Log.d(TAG, "================= application is logging call composite dismissed =================");
188+
});
170189

171190
if (URLUtil.isValidUrl(meetingInput.trim())) {
172191
CallCompositeJoinLocator locator = new CallCompositeTeamsMeetingLinkLocator(meetingInput);
@@ -186,10 +205,7 @@ public void launchComposite(String displayName, String meetingInput, ReadableMap
186205
CallCompositeParticipantViewData participantViewData = new CallCompositeParticipantViewData()
187206
.setDisplayName(displayName)
188207
.setAvatarBitmap(avatarImageBitmap);
189-
190-
191208
localOptions.setParticipantViewData(participantViewData);
192-
193209
}
194210

195211
if (title != null) {

AzureCommunicationUIDemoApp/android/build.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ buildscript {
44
ext {
55
buildToolsVersion = "30.0.2"
66
minSdkVersion = 23
7-
compileSdkVersion = 31
8-
targetSdkVersion = 31
7+
compileSdkVersion = 33
8+
targetSdkVersion = 33
99
ndkVersion = "21.4.7075529"
1010
}
1111
repositories {
1212
google()
1313
mavenCentral()
1414
}
1515
dependencies {
16-
classpath("com.android.tools.build:gradle:4.2.2")
16+
classpath("com.android.tools.build:gradle:7.0.0")
1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files
1919
}
@@ -31,7 +31,9 @@ allprojects {
3131
// Android JSC is installed from npm
3232
url("$rootDir/../node_modules/jsc-android/dist")
3333
}
34-
34+
maven {
35+
url 'file:///Users/inderpalsinghaulakh/.m2/repository'
36+
}
3537
maven { url "https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1" }
3638

3739
google()

AzureCommunicationUIDemoApp/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ android.useAndroidX=true
2525
android.enableJetifier=true
2626

2727
org.gradle.jvmargs=-Xmx4608m
28-
org.gradle.java.home=/Applications/Android Studio.app/Contents/jre/Contents/Home
28+
org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
2929
# Version of flipper SDK to use with React Native
3030
FLIPPER_VERSION=0.99.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export NODE_BINARY=$(command -v node)

AzureCommunicationUIDemoApp/ios/AzureCommunicationUIDemoApp.xcodeproj/project.pbxproj

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@
506506
buildSettings = {
507507
ALWAYS_SEARCH_USER_PATHS = NO;
508508
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
509-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
509+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
510510
CLANG_CXX_LIBRARY = "libc++";
511511
CLANG_ENABLE_MODULES = YES;
512512
CLANG_ENABLE_OBJC_ARC = YES;
@@ -535,14 +535,15 @@
535535
ENABLE_BITCODE = NO;
536536
ENABLE_STRICT_OBJC_MSGSEND = YES;
537537
ENABLE_TESTABILITY = YES;
538-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
538+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
539539
GCC_C_LANGUAGE_STANDARD = gnu99;
540540
GCC_DYNAMIC_NO_PIC = NO;
541541
GCC_NO_COMMON_BLOCKS = YES;
542542
GCC_OPTIMIZATION_LEVEL = 0;
543543
GCC_PREPROCESSOR_DEFINITIONS = (
544544
"DEBUG=1",
545545
"$(inherited)",
546+
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
546547
);
547548
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
548549
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -551,6 +552,14 @@
551552
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
552553
GCC_WARN_UNUSED_FUNCTION = YES;
553554
GCC_WARN_UNUSED_VARIABLE = YES;
555+
HEADER_SEARCH_PATHS = (
556+
"$(inherited)",
557+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
558+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
559+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
560+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
561+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
562+
);
554563
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
555564
LD_RUNPATH_SEARCH_PATHS = (
556565
/usr/lib/swift,
@@ -563,6 +572,13 @@
563572
);
564573
MTL_ENABLE_DEBUG_INFO = YES;
565574
ONLY_ACTIVE_ARCH = YES;
575+
OTHER_CFLAGS = "$(inherited)";
576+
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
577+
OTHER_LDFLAGS = (
578+
"$(inherited)",
579+
"-Wl",
580+
"-ld_classic",
581+
);
566582
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
567583
SDKROOT = iphoneos;
568584
};
@@ -573,7 +589,7 @@
573589
buildSettings = {
574590
ALWAYS_SEARCH_USER_PATHS = NO;
575591
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
576-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
592+
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
577593
CLANG_CXX_LIBRARY = "libc++";
578594
CLANG_ENABLE_MODULES = YES;
579595
CLANG_ENABLE_OBJC_ARC = YES;
@@ -602,15 +618,27 @@
602618
ENABLE_BITCODE = NO;
603619
ENABLE_NS_ASSERTIONS = NO;
604620
ENABLE_STRICT_OBJC_MSGSEND = YES;
605-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
621+
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
606622
GCC_C_LANGUAGE_STANDARD = gnu99;
607623
GCC_NO_COMMON_BLOCKS = YES;
624+
GCC_PREPROCESSOR_DEFINITIONS = (
625+
"$(inherited)",
626+
_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION,
627+
);
608628
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
609629
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
610630
GCC_WARN_UNDECLARED_SELECTOR = YES;
611631
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
612632
GCC_WARN_UNUSED_FUNCTION = YES;
613633
GCC_WARN_UNUSED_VARIABLE = YES;
634+
HEADER_SEARCH_PATHS = (
635+
"$(inherited)",
636+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
637+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
638+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
639+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
640+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
641+
);
614642
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
615643
LD_RUNPATH_SEARCH_PATHS = (
616644
/usr/lib/swift,
@@ -622,6 +650,13 @@
622650
"\"$(inherited)\"",
623651
);
624652
MTL_ENABLE_DEBUG_INFO = NO;
653+
OTHER_CFLAGS = "$(inherited)";
654+
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
655+
OTHER_LDFLAGS = (
656+
"$(inherited)",
657+
"-Wl",
658+
"-ld_classic",
659+
);
625660
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
626661
SDKROOT = iphoneos;
627662
SWIFT_COMPILATION_MODE = wholemodule;
Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,57 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3-
source 'https://github.com/CocoaPods/Specs.git'
1+
#require_relative '../node_modules/react-native/scripts/react_native_pods'
2+
#require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3+
#source 'https://github.com/CocoaPods/Specs.git'
4+
5+
# Resolve react_native_pods.rb with node to allow for hoisting
6+
require Pod::Executable.execute_command('node', ['-p',
7+
'require.resolve(
8+
"react-native/scripts/react_native_pods.rb",
9+
{paths: [process.argv[1]]},
10+
)', __dir__]).strip
411

512
platform :ios, '14.0'
613

14+
prepare_react_native_project!
15+
16+
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
17+
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
18+
#
19+
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
20+
# ```js
21+
# module.exports = {
22+
# dependencies: {
23+
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
24+
# ```
25+
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
26+
27+
linkage = ENV['USE_FRAMEWORKS']
28+
if linkage != nil
29+
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
30+
use_frameworks! :linkage => linkage.to_sym
31+
end
32+
733
target 'AzureCommunicationUIDemoApp' do
834
use_frameworks!
9-
pod 'AzureCommunicationUICalling', '1.3.0'
35+
pod 'AzureCommunicationUICalling', '1.4.0'
1036

1137

1238
config = use_native_modules!
1339

40+
# Flags change depending on the env values.
41+
flags = get_default_flags()
42+
1443
use_react_native!(
1544
:path => config[:reactNativePath],
16-
# to enable hermes on iOS, change `false` to `true` and then install pods
17-
:hermes_enabled => false
45+
# Hermes is now enabled by default. Disable by setting this flag to false.
46+
:hermes_enabled => flags[:hermes_enabled],
47+
:fabric_enabled => flags[:fabric_enabled],
48+
# Enables Flipper.
49+
#
50+
# Note that if you have use_frameworks! enabled, Flipper will not work and
51+
# you should disable the next line.
52+
# :flipper_configuration => flipper_config,
53+
# An absolute path to your application root.
54+
:app_path => "#{Pod::Config.instance.installation_root}/.."
1855
)
1956

2057
target 'AzureCommunicationUIDemoAppTests' do
@@ -28,14 +65,23 @@ target 'AzureCommunicationUIDemoApp' do
2865
# you should disable the next line.
2966
# use_flipper!()
3067

68+
pre_install do |installer|
69+
installer.pod_targets.each do |pod|
70+
if pod.name.eql?('RNScreens')
71+
def pod.build_type
72+
Pod::BuildType.static_library
73+
end
74+
end
75+
end
76+
end
77+
3178
post_install do |installer|
32-
react_native_post_install(installer)
33-
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
34-
installer.pods_project.targets.each do |target|
35-
# Fix up using the simulator on M1 macs due to the calling library.
36-
target.build_configurations.each do |config|
37-
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
38-
end
39-
end
79+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
80+
react_native_post_install(
81+
installer,
82+
config[:reactNativePath],
83+
:mac_catalyst_enabled => false
84+
)
85+
__apply_Xcode_12_5_M1_post_install_workaround(installer)
4086
end
4187
end

0 commit comments

Comments
 (0)