Deep link to iOS Settings from Notifications prefs
This commit is contained in:
parent
1eec70449d
commit
f87da10a29
|
@ -24,6 +24,24 @@ struct NotificationsPrefsView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.appGroupedListRowBackground()
|
.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)
|
.listStyle(.insetGrouped)
|
||||||
.appGroupedListBackground(container: PreferencesNavigationController.self)
|
.appGroupedListBackground(container: PreferencesNavigationController.self)
|
||||||
|
|
Loading…
Reference in New Issue