Skip to content

Commit 4f89154

Browse files
authored
Merge pull request #278526 from iaulakh/iaulakh/1_to_1_calling_beta
1 to 1 calling beta release with Telecom Manager and CallKit
2 parents 245c242 + 9ac847a commit 4f89154

File tree

9 files changed

+393
-319
lines changed

9 files changed

+393
-319
lines changed

articles/communication-services/concepts/ui-library/includes/mobile-ui-use-cases.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ You can use the call composite in Communication Services to create these use cas
1414

1515
| Area | Use cases |
1616
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
17-
| Call types | Join a Microsoft Teams meeting |
18-
| | Join a Microsoft Teams meeting using Meeting ID and Passcode |
19-
| | Join a call by using a group ID |
17+
| Call types | Join a Microsoft Teams meeting |
18+
| | Join a Microsoft Teams meeting using Meeting ID and Passcode |
19+
| | Join a call by using a group ID |
20+
| | Join a call by using a room ID |
21+
| | Make and Receive 1:1 Calls |
2022
| [Teams interoperability](../../teams-interop.md) | Join the call lobby |
2123
| | Display a transcription and recording alert banner |
24+
| | Admit/Reject lobby participants |
2225
| Participant gallery | Show remote participants on a grid |
2326
| | Make video preview available throughout a call for a local user |
2427
| | Make default avatars available when video is off |
@@ -30,10 +33,12 @@ You can use the call composite in Communication Services to create these use cas
3033
| | Manage the speaker device (wired or Bluetooth) |
3134
| | Make local preview available for a user to check video |
3235
| | Enable end call confirmation dialogue |
36+
| | Skip setup screen |
3337
| Call controls | Mute and unmute a call |
3438
| | Turn video on or off during a call |
3539
| | End a call |
3640
| | Hold and resume a call after audio interruption |
41+
| | CallKit and TelecomManager Support |
3742

3843
### Teams interoperability
3944

@@ -99,6 +104,10 @@ UI Library supports picture in picture mode for call screen. While being in the
99104

100105
UI Library supports CallKit Integration to handle interaction with CallKit for calls. To learn more about the integration for iOS platform and usage of the API, see [How to use CallKit.](../../../how-tos/ui-library-sdk/callkit.md)
101106

107+
### TelecomManager support
108+
109+
The UI Library now supports integration with the TelecomManager, allowing for handling of call hold and resume functions. To learn more about the integration for Android platform and usage of the API, see [How to use TelecomManager.](../../../how-tos/ui-library-sdk/telecommanager.md)
110+
102111
### One-to-one call and PUSH notification support
103112

104113
UI Library supports one-to-one VoIP call to dial users by communication identifier. To receive incoming call UI Library also supports registering for PUSH notifications. To learn more about the integration for Android and iOS platform and usage of the API, see [How to make one-to-one call and receive PUSH notifications.](../../../how-tos/ui-library-sdk/one-to-one-calling.md)

articles/communication-services/how-tos/ui-library-sdk/callkit.md

Lines changed: 62 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,63 @@ The Azure Communication Services UI Library provides out-of-the-box support for
1717

1818
In this article, you learn how to set up CallKit correctly by using the UI Library in your application.
1919

20-
[!INCLUDE [Public Preview Notice](../../includes/public-preview-include.md)]
21-
2220
## Prerequisites
2321

2422
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2523
- A deployed Communication Services resource. [Create a Communication Services resource](../../quickstarts/create-communication-resource.md).
2624
- A user access token to enable the call client. [Get a user access token](../../quickstarts/identity/access-tokens.md).
27-
- Optional: Completion of the [quickstart for getting started with the UI Library composites](../../quickstarts/ui-library/get-started-composites.md).
25+
- Optional: Completion of the [QuickStart for getting started with the UI Library composites](../../quickstarts/ui-library/get-started-composites.md).
2826

2927
For more information, see the [open-source iOS UI Library](https://github.com/Azure/communication-ui-library-ios) and the [sample application code](https://github.com/Azure-Samples/communication-services-ios-quickstarts/tree/main/ui-calling).
3028

3129
### Set up CallKit integration
3230

33-
The Azure Communication Services Calling iOS SDK supports CallKit integration. You can enable this integration in the UI Library by configuring an instance of `CallCompositeCallKitOption`. For more information, see [Integrate with CallKit](/azure/communication-services/how-tos/calling-sdk/callkit-integration#callkit-integration-within-sdk).
31+
The Azure Communication Services Calling iOS SDK supports CallKit integration. You can enable this integration in the UI Library by configuring an instance of `CallCompositeCallKitOption`. For more information, see [Integrate with CallKit](../calling-sdk/callkit-integration.md).
3432

35-
### Specify call recipient info for incoming and outgoing calls
33+
### Specify call recipient info for outgoing calls
3634

37-
To specify call recipient info, create an instance of `CallCompositeCallKitRemoteInfo`.
35+
To specify outgoing call info, create an instance of `CallKitRemoteInfo`. If you don't provide `CallKitRemoteInfo`, the participant identifier's raw value is displayed by default.
3836

39-
Assign a value for `displayName` to customize the display name for call recipients. The value specified in `displayName` is exactly how it appears in the last-dialed call log.
37+
Assign a value for `displayName` to customize the display name for caller. The value specified in `CallKitRemoteInfo` is exactly how it appears in the last-dialed call log.
4038

4139
Also assign the `cxHandle` value. It's what the application receives when the user calls back on that contact.
4240

4341
```swift
4442
let cxHandle = CXHandle(type: .generic, value: "VALUE_TO_CXHANDLE")
45-
var displayName = "DISPLAY_NAME"
46-
let callKitRemoteInfo = CallCompositeCallKitRemoteInfo(displayName: displayName, cxHandle: cxHandle)
43+
let callKitRemoteInfo = CallKitRemoteInfo(displayName: "DISPLAY_NAME", handle: cxHandle)
44+
callComposite.launch(..., // Locator for Azure Communication Service
45+
callKitRemoteInfo: callKitRemoteInfo)
4746
```
4847

49-
If you don't provide `CallCompositeCallKitRemoteInfo`, the participant identifier's raw value is displayed by default.
48+
### Specify call recipient info for incoming calls
49+
50+
To specify incoming call caller info, create an instance of `CallKitOptions`. If you don't provide `CallKitOptions`, the participant identifier's raw value is displayed by default.
51+
52+
Assign a value for `provideRemoteInfo` to customize the display name for caller. The value specified in `CallKitRemoteInfo` is exactly how it appears in the last-dialed call log.
53+
54+
Also assign the `cxHandle` value. It's what the application receives when the user calls back on that contact.
55+
56+
```swift
57+
public func incomingCallRemoteInfo(info: Caller) -> CallKitRemoteInfo {
58+
let cxHandle = CXHandle(type: .generic, value: "VALUE_TO_CXHANDLE")
59+
var remoteInfoDisplayName = "DISPLAY_NAME"
60+
let callKitRemoteInfo = CallKitRemoteInfo(displayName: remoteInfoDisplayName,
61+
handle: cxHandle)
62+
return callKitRemoteInfo
63+
}
64+
```
5065

5166
### Configure providers
5267

53-
As required, provide a `CallCompositeCallKitRemoteInfo` instance to `CallCompositeCallKitOption`. The UI Library also provides a default provider: `CallCompositeCallKitOption.getDefaultCXProviderConfiguration()`. For more information, see the [Apple developer documentation about CXProviderConfiguration](https://developer.apple.com/documentation/callkit/cxproviderconfiguration).
68+
As required, provide a `CXProviderConfiguration` instance to `CallKitOptions`. For more information, see the [Apple developer documentation about CXProviderConfiguration](https://developer.apple.com/documentation/callkit/cxproviderconfiguration).
5469

5570
```swift
56-
let cxProvider = CallCompositeCallKitOption.getDefaultCXProviderConfiguration()
71+
let providerConfig = CXProviderConfiguration()
72+
providerConfig.supportsVideo = true
73+
providerConfig.maximumCallGroups = 1
74+
providerConfig.maximumCallsPerCallGroup = 1
75+
providerConfig.includesCallsInRecents = true
76+
providerConfig.supportedHandleTypes = [.phoneNumber, .generic]
5777
```
5878

5979
### Configure an audio session
@@ -63,6 +83,7 @@ Configure an audio session to be called before placing or accepting incoming cal
6383
```swift
6484
public func configureAudioSession() -> Error? {
6585
let audioSession = AVAudioSession.sharedInstance()
86+
let options: AVAudioSession.CategoryOptions = .allowBluetooth
6687
var configError: Error?
6788
do {
6889
try audioSession.setCategory(.playAndRecord)
@@ -75,23 +96,47 @@ public func configureAudioSession() -> Error? {
7596

7697
### Enable CallKit
7798

78-
To enable CallKit, create an instance of `CallCompositeCallKitOption` and provide it to `RemoteOptions`.
99+
To enable CallKit, create an instance of `CallKitOptions` and provide it to `callCompositeOptions`.
79100

80101
```swift
81102
let isCallHoldSupported = true // enable call hold (default is true)
82-
let callKitOptions = CallCompositeCallKitOption(
83-
cxProvideConfig: cxProvider,
103+
let callKitOptions = CallKitOptions(
104+
providerConfig: providerConfig,
84105
isCallHoldSupported: isCallHoldSupported,
85-
remoteInfo: callKitRemoteInfo,
106+
provideRemoteInfo: provideRemoteInfo,
86107
configureAudioSession: configureAudioSession
87108
)
88109

89-
let remoteOptions = RemoteOptions(
110+
let options = CallCompositeOptions(
90111
..., // Other options for Azure Communication Service
91112
callKitOptions: callKitOptions
92113
)
93114
```
94115

116+
### Hold and Resume API for CallKit integrated in application
117+
118+
For CallKit integrated in application use `hold` and `resume` to manage call state.
119+
120+
```kotlin
121+
callComposite.hold() { result in
122+
switch result {
123+
case .success:
124+
// success
125+
case .failure(let error):
126+
// failure
127+
}
128+
}
129+
130+
callComposite.resume() { result in
131+
switch result {
132+
case .success:
133+
// success
134+
case .failure(let error):
135+
// failure
136+
}
137+
}
138+
```
139+
95140
## Next steps
96141

97142
- [Learn more about the UI Library](../../concepts/ui-library/ui-library-overview.md)

0 commit comments

Comments
 (0)