@@ -17,7 +17,7 @@ ms.subservice: calling
17
17
User-facing diagnostics is an extended feature of the core ` Call ` API and allows you to diagnose an active call.
18
18
19
19
``` swift
20
- let userFacingDiagnostics = self .call ? .feature (Features.diagnostics )
20
+ let userFacingDiagnostics = self .call ? .feature (Features.localUserDiagnostics )
21
21
```
22
22
23
23
## User Facing Diagnostic events
@@ -27,117 +27,117 @@ let userFacingDiagnostics = self.call?.feature(Features.diagnostics)
27
27
``` swift
28
28
extension CallObserver : MediaDiagnosticsDelegate {
29
29
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
30
- didChangeCameraFreezeValue args : FlagDiagnosticChangedEventArgs ) {
30
+ didChangeIsCameraFrozen args : DiagnosticFlagChangedEventArgs ) {
31
31
let newValue = args.value
32
32
// Handle the diagnostic event value changed...
33
33
}
34
34
35
35
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
36
- didChangeSpeakerMutedValue args : FlagDiagnosticChangedEventArgs ) {
36
+ didChangeIsSpeakerMuted args : DiagnosticFlagChangedEventArgs ) {
37
37
let newValue = args.value
38
38
// Handle the diagnostic event value changed...
39
39
}
40
-
40
+
41
41
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
42
- didChangeCameraStartFailedValue args : FlagDiagnosticChangedEventArgs ) {
42
+ didChangeIsCameraStartFailed args : DiagnosticFlagChangedEventArgs ) {
43
43
let newValue = args.value
44
44
// Handle the diagnostic event value changed...
45
45
}
46
-
46
+
47
47
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
48
- didChangeSpeakerNotFunctioningValue args : FlagDiagnosticChangedEventArgs ) {
48
+ didChangeIsSpeakerVolumeZero args : DiagnosticFlagChangedEventArgs ) {
49
49
let newValue = args.value
50
50
// Handle the diagnostic event value changed...
51
51
}
52
-
52
+
53
53
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
54
- didChangeCameraPermissionDeniedValue args : FlagDiagnosticChangedEventArgs ) {
54
+ didChangeIsSpeakerNotFunctioning args : DiagnosticFlagChangedEventArgs ) {
55
55
let newValue = args.value
56
56
// Handle the diagnostic event value changed...
57
57
}
58
-
58
+
59
59
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
60
- didChangeMicrophoneNotFunctioningValue args : FlagDiagnosticChangedEventArgs ) {
60
+ didChangeIsCameraPermissionDenied args : DiagnosticFlagChangedEventArgs ) {
61
61
let newValue = args.value
62
62
// Handle the diagnostic event value changed...
63
63
}
64
-
64
+
65
65
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
66
- didChangeMicrophoneMuteUnexpectedlyValue args : FlagDiagnosticChangedEventArgs ) {
66
+ didChangeIsMicrophoneNotFunctioning args : DiagnosticFlagChangedEventArgs ) {
67
67
let newValue = args.value
68
68
// Handle the diagnostic event value changed...
69
69
}
70
-
70
+
71
71
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
72
- didChangeCameraStartTimedOutValue args : FlagDiagnosticChangedEventArgs ) {
72
+ didChangeIsCameraStartTimedOut args : DiagnosticFlagChangedEventArgs ) {
73
73
let newValue = args.value
74
74
// Handle the diagnostic event value changed...
75
75
}
76
-
76
+
77
77
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
78
- didChangeSpeakerVolumeIsZeroValue args : FlagDiagnosticChangedEventArgs ) {
78
+ didChangeIsMicrophoneMutedUnexpectedly args : DiagnosticFlagChangedEventArgs ) {
79
79
let newValue = args.value
80
80
// Handle the diagnostic event value changed...
81
81
}
82
-
82
+
83
83
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
84
- didChangeNoSpeakerDevicesEnumeratedValue args : FlagDiagnosticChangedEventArgs ) {
84
+ didChangeIsZeroSpeakerDevicesAvailable args : DiagnosticFlagChangedEventArgs ) {
85
85
let newValue = args.value
86
- // Handle the diagnostic event value changed...
86
+ // Handle the diagnostic event value changed...
87
87
}
88
-
88
+
89
89
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
90
- didChangeNoMicrophoneDevicesEnumeratedValue args : FlagDiagnosticChangedEventArgs ) {
90
+ didChangeIsZeroMicrophoneDevicesAvailable args : DiagnosticFlagChangedEventArgs ) {
91
91
let newValue = args.value
92
92
// Handle the diagnostic event value changed...
93
93
}
94
-
94
+
95
95
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
96
- didChangeSpeakingWhileMicrophoneIsMutedValue args : FlagDiagnosticChangedEventArgs ) {
96
+ didChangeIsSpeakingWhileMicrophoneIsMuted args : DiagnosticFlagChangedEventArgs ) {
97
97
let newValue = args.value
98
98
// Handle the diagnostic event value changed...
99
99
}
100
-
100
+
101
101
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
102
- didChangeSpeakerNotFunctioningDeviceInUseValue args : FlagDiagnosticChangedEventArgs ) {
102
+ didChangeIsSpeakerBusy args : DiagnosticFlagChangedEventArgs ) {
103
103
let newValue = args.value
104
104
// Handle the diagnostic event value changed...
105
105
}
106
-
106
+
107
107
func mediaDiagnostics (_ mediaDiagnostics : MediaDiagnostics,
108
- didChangeMicrophoneNotFunctioningDeviceInUseValue args : FlagDiagnosticChangedEventArgs ) {
108
+ didChangeIsMicrophoneBusy args : DiagnosticFlagChangedEventArgs ) {
109
109
let newValue = args.value
110
110
// Handle the diagnostic event value changed...
111
111
}
112
112
}
113
113
114
114
extension CallObserver : NetworkDiagnosticsDelegate {
115
115
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
116
- didChangeNoNetworkValue args : FlagDiagnosticChangedEventArgs ) {
116
+ didChangeIsNetworkRelaysUnreachable args : DiagnosticFlagChangedEventArgs ) {
117
117
let newValue = args.value
118
118
// Handle the diagnostic event value changed...
119
119
}
120
-
120
+
121
121
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
122
- didChangeNetworkReconnectValue args : QualityDiagnosticChangedEventArgs ) {
122
+ didChangeNetworkReconnectionQuality args : DiagnosticQualityChangedEventArgs ) {
123
123
let newValue = args.value
124
124
// Handle the diagnostic event value changed...
125
125
}
126
-
126
+
127
127
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
128
- didChangeNetworkSendQualityValue args : QualityDiagnosticChangedEventArgs ) {
128
+ didChangeNetworkSendQuality args : DiagnosticQualityChangedEventArgs ) {
129
129
let newValue = args.value
130
130
// Handle the diagnostic event value changed...
131
131
}
132
-
132
+
133
133
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
134
- didChangeNetworkReceiveQualityValue args : QualityDiagnosticChangedEventArgs ) {
134
+ didChangeIsNetworkUnavailable args : DiagnosticFlagChangedEventArgs ) {
135
135
let newValue = args.value
136
136
// Handle the diagnostic event value changed...
137
137
}
138
-
138
+
139
139
func networkDiagnostics (_ networkDiagnostics : NetworkDiagnostics,
140
- didChangeNetworkRelaysNotReachableValue args : FlagDiagnosticChangedEventArgs ) {
140
+ didChangeNetworkReceiveQuality args : DiagnosticQualityChangedEventArgs ) {
141
141
let newValue = args.value
142
142
// Handle the diagnostic event value changed...
143
143
}
@@ -153,13 +153,16 @@ self.mediaDiagnostics?.delegate = self.callObserver
153
153
self .networkDiagnostics ? .delegate = self .callObserver
154
154
```
155
155
156
+ > [ !NOTE]
157
+ > If you have [ ` CallKit ` ] ( ../../../how-tos/calling-sdk/callkit-integration.md ) enabled via SDK or implement CallKit integration in your application, reporting mute state to CallKit can result in the OS making the application loose the hold to microphone due to privacy reasons which would cause the ` didIsSpeakingWhileMicrophoneIsMuted ` event not to work as expected because we cannot capture input from microphone device to detect that the user is speaking.
158
+
156
159
## Get the latest User Facing Diagnostics
157
160
158
161
- Get the latest diagnostic values that were raised. If we still didn't receive a value for the diagnostic, ` nil ` or ` .unknown ` is returned.
159
162
160
163
``` swift
161
- let lastSpeakerNotFunctionValue = self .mediaDiagnostics .latest .speakerNotFunctioning // Boolean?
162
- let lastNetworkRelayNotReachableValue = self .networkDiagnostics .latest .networkRelaysNotReachable // Boolean?
164
+ let lastSpeakerNotFunctionValue = self .mediaDiagnostics .latest .isSpeakerNotFunctioning // Boolean?
165
+ let lastNetworkRelayNotReachableValue = self .networkDiagnostics .latest .networkRelaysUnreachable // Boolean?
163
166
let lastReceiveQualityValue = self .networkDiagnostics .latest .networkReceiveQuality // DiagnosticQuality (.good, .poor, .bad)
164
167
// or .unknown if there isn't a diagnostic for this.
165
168
```
0 commit comments