簡體   English   中英

App-Prefs:root=NOTIFICATIONS_ID 不適用於 iOS 11 Swift 4

[英]App-Prefs: root=NOTIFICATIONS_ID Not working on iOS 11 Swift 4

我正在嘗試使用:

UIApplication.shared.open(URL(string:"App-Prefs:root=NOTIFICATIONS_ID")!, options: [:], completionHandler: nil)

但它只是將我發送到“設置”應用程序,而不是“通知”選項卡。

我試過這個沒有運氣。

有什么解決辦法嗎?

Apple 將拒絕您提交的應用程序。 因為這是私有api。 在下面使用下面的功能。 參考: 單擊按鈕時如何打開手機設置?

guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {
    return
}

if UIApplication.shared.canOpenURL(settingsUrl) {
    UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
         print("Settings opened: \(success)") // Prints true
    })
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM