mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-21 14:55:44 +00:00
ios: show button for opening settings when asking for microphone permission to record voice message (#1459)
This commit is contained in:
@@ -124,14 +124,14 @@ struct ContentView: View {
|
||||
func notificationAlert() -> Alert {
|
||||
Alert(
|
||||
title: Text("Notifications are disabled!"),
|
||||
message: Text("The app can notify you when you receive messages or contact requests - please open settings to enable."),
|
||||
primaryButton: .default(Text("Open Settings")) {
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
|
||||
}
|
||||
},
|
||||
secondaryButton: .cancel()
|
||||
)
|
||||
message: Text("The app can notify you when you receive messages or contact requests - please open settings to enable."),
|
||||
primaryButton: .default(Text("Open Settings")) {
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
|
||||
}
|
||||
},
|
||||
secondaryButton: .cancel()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -476,10 +476,16 @@ struct ComposeView: View {
|
||||
if let recStartError = await audioRecorder?.start(fileName: fileName) {
|
||||
switch recStartError {
|
||||
case .permission:
|
||||
AlertManager.shared.showAlertMsg(
|
||||
title: "No permission to record voice message",
|
||||
message: "To record voice message please grant permission to use Microphone."
|
||||
)
|
||||
AlertManager.shared.showAlert(Alert(
|
||||
title: Text("No permission to record voice message"),
|
||||
message: Text("To record voice message please grant permission to use Microphone."),
|
||||
primaryButton: .default(Text("Open Settings")) {
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)
|
||||
}
|
||||
},
|
||||
secondaryButton: .cancel()
|
||||
))
|
||||
case let .error(error):
|
||||
AlertManager.shared.showAlertMsg(
|
||||
title: "Unable to record voice message",
|
||||
|
||||
Reference in New Issue
Block a user