Posted at

OS別 設定画面へのリンク

More than 1 year has passed since last update.

通知画面へのリンク iOS11以下

guard let bundle = Bundle.main.bundleIdentifier else { return }

if #available(iOS 11.0, *) {
let path = "app-settings:root=NOTIFICATIONS_ID&path=" + bundle
if let url = URL(string: path) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
} else if #available(iOS 10.0, *) {
let path = "App-prefs:root=NOTIFICATIONS_ID&path=" + bundle
if let url = URL(string: path) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
} else {
let path = "prefs:root=NOTIFICATIONS_ID&path=" + bundle
if let url = URL(string: path) {
UIApplication.shared.openURL(url)
}
}

通知画面以外のURLスキーマはこちらから