Deep link to iOS Settings from Notifications prefs

This commit is contained in:
Shadowfacts 2024-04-12 22:54:17 -04:00
parent 1eec70449d
commit f87da10a29
1 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,24 @@ struct NotificationsPrefsView: View {
}
}
.appGroupedListRowBackground()
if #available(iOS 15.4, *) {
Section {
Button {
let str = if #available(iOS 16.0, *) {
UIApplication.openNotificationSettingsURLString
} else {
UIApplicationOpenNotificationSettingsURLString
}
if let url = URL(string: str) {
UIApplication.shared.open(url)
}
} label: {
Text("Open Notification Settings…")
}
}
.appGroupedListRowBackground()
}
}
.listStyle(.insetGrouped)
.appGroupedListBackground(container: PreferencesNavigationController.self)