Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WEBRTC-2325] [FIX] Handle CallKit Mute / Unmute buttons #146

Merged
merged 5 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: sync mute button state in CallView with call state when app ent…
…ers foreground
  • Loading branch information
gbattistel committed Dec 9, 2024
commit df01d4b78818e4d57f860c366c7238301cdab8c7
14 changes: 14 additions & 0 deletions TelnyxWebRTCDemo/ViewController.swift
Original file line number Diff line number Diff line change
@@ -76,6 +76,15 @@ class ViewController: UIViewController {
self.telnyxClient = appDelegate.telnyxClient
self.initViews()

// Register notifications
NotificationCenter.default.addObserver(self,
selector: #selector(appWillEnterForeground),
name: UIApplication.willEnterForegroundNotification,
object: nil)
}

deinit {
NotificationCenter.default.removeObserver(self)
}

func initViews() {
@@ -132,6 +141,11 @@ class ViewController: UIViewController {
self.showHiddenOptions()
}
}

@objc func appWillEnterForeground() {
print("ViewController:: App is about to enter the foreground")
self.callView.isMuted = self.appDelegate.currentCall?.isMuted ?? false
}

func showHiddenOptions() {
let alert = UIAlertController(title: "Options", message: "", preferredStyle: .actionSheet)