Skip to content

Commit

Permalink
Merge pull request #330 from posawatji/master
Browse files Browse the repository at this point in the history
Add `isMuted` to check CallKit mic status on iOS
  • Loading branch information
hiennguyen92 committed Sep 23, 2023
2 parents 16986c2 + 95e1acc commit b8d385d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ios/Classes/SwiftFlutterCallkitIncomingPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ public class SwiftFlutterCallkitIncomingPlugin: NSObject, FlutterPlugin, CXProvi
self.muteCall(callId, isMuted: isMuted)
result("OK")
break
case "isMuted":
guard let args = call.arguments as? [String: Any] ,
let callId = args["id"] as? String else{
result(false)
return
}
guard let callUUID = UUID(uuidString: callId),
let call = self.callManager.callWithUUID(uuid: callUUID) else {
result(false)
return
}
result(call.isMuted)
break
case "holdCall":
guard let args = call.arguments as? [String: Any] ,
let callId = args["id"] as? String,
Expand Down
7 changes: 7 additions & 0 deletions lib/flutter_callkit_incoming.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ class FlutterCallkitIncoming {
await _channel.invokeMethod("muteCall", {'id': id, 'isMuted': isMuted});
}

/// Get Callkit Mic Status (muted/unmuted).
/// On iOS, using Callkit(update call ui).
/// On Android, Nothing(only callback event listener).
static Future<bool> isMuted(String id) async {
return (await _channel.invokeMethod("isMuted", {'id': id})) as bool? ?? false;
}

/// Hold an Ongoing call.
/// On iOS, using Callkit(update the ongoing call ui).
/// On Android, Nothing(only callback event listener).
Expand Down

0 comments on commit b8d385d

Please sign in to comment.