Skip to content

Commit 49c4e2b

Browse files
Merge pull request #251132 from iaulakh/patch-24
Update UI communication calling QuickStart
2 parents fbc2cd3 + c733dad commit 49c4e2b

File tree

2 files changed

+74
-0
lines changed
  • articles/communication-services/quickstarts/ui-library/includes/get-started-call

2 files changed

+74
-0
lines changed

articles/communication-services/quickstarts/ui-library/includes/get-started-call/android.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,56 @@ CallComposite callComposite =
502502
.build();
503503
```
504504

505+
---
506+
### Subscribe to CallComposite call state changed event
507+
508+
To receive call state changed events, call `addOnCallStateChangedEventHandler` with `CallComposite`.
509+
510+
The following example shows an event for a call state changed.
511+
512+
#### [Kotlin](#tab/kotlin)
513+
514+
```kotlin
515+
callComposite.addOnCallStateChangedEventHandler { callStateChangedEvent ->
516+
println(callStateChangedEvent.code)
517+
}
518+
```
519+
520+
#### [Java](#tab/java)
521+
522+
```java
523+
callComposite.addOnCallStateChangedEventHandler(callStateChangedEvent -> {
524+
System.out.println(callStateChangedEvent.getCode());
525+
});
526+
```
527+
528+
---
529+
### Dismiss CallComposite and subscribe to dismissed event
530+
531+
To receive dismiss, call `addOnDismissedEventHandler` with `CallComposite`. To dismiss CallComposite, call `dismiss`.
532+
533+
The following example shows an event for a call state changed.
534+
535+
#### [Kotlin](#tab/kotlin)
536+
537+
```kotlin
538+
callComposite.addOnDismissedEventHandler { callCompositeDismissedEvent ->
539+
println(callCompositeDismissedEvent.errorCode)
540+
}
541+
542+
callComposite.dismiss()
543+
```
544+
545+
#### [Java](#tab/java)
546+
547+
```java
548+
callComposite.addOnDismissedEventHandler(callCompositeDismissedEvent -> {
549+
System.out.println(callCompositeDismissedEvent.getErrorCode());
550+
});
551+
552+
callComposite.dismiss();
553+
```
554+
505555
---
506556
### More features
507557

articles/communication-services/quickstarts/ui-library/includes/get-started-call/ios.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,30 @@ let callCompositeOptions = CallCompositeOptions(localization: localizationOption
297297

298298
For more information about localization and for a list of supported languages, see the [localization guide](../../../../how-tos/ui-library-sdk/localization.md).
299299

300+
### Subscribe to CallComposite call state changed event
301+
302+
You can implement closures to act on composite events. The call states will be sent to the call state changed handler.
303+
304+
The following example shows an event for a call state changed.
305+
306+
```swift
307+
callComposite?.events.onCallStateChanged = { callStateEvent in
308+
print("CallComposite call state changed:\(callStateEvent.requestString)")
309+
}
310+
```
311+
312+
### Dismiss CallComposite and subscribe to dismissed event
313+
314+
To dismiss CallComposite, call `dismiss`. The following dismiss event be sent on call composite dismissed:
315+
316+
```swift
317+
callComposite?.events.onDismissed = { dismissed in
318+
print("CallComposite dismissed:\(dismissed.errorCode)")
319+
}
320+
321+
callComposite.dismiss()
322+
```
323+
300324
## Add notifications to your mobile app
301325

302326
Azure Communication Services integrates with [Azure Event Grid](../../../../../event-grid/overview.md) and [Azure Notification Hubs](../../../../../notification-hubs/notification-hubs-push-notification-overview.md), so you can [add push notifications](../../../../concepts/notifications.md) to your apps in Azure. You can use push notifications to send information from your application to users' mobile devices. A push notification can show a dialog, play a sound, or display an incoming call UI.

0 commit comments

Comments
 (0)