LoginSignup
11
10

More than 5 years have passed since last update.

OS別 設定画面へのリンク

Posted at

通知画面へのリンク 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スキーマはこちらから

11
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
10