[英]Get User's Notification settings
我嘗試用Google搜索我的問題並遇到了這個問題,但是解決方案中提供的鏈接已刪除。
如果您專門嘗試閱讀通知設置和選項,則可以執行此操作。 然后,如果他們要更改設置,可以直接將它們直接帶到設置應用程序。
UNUserNotificationCenter.current().getNotificationSettings(){ (settings) in
switch settings.soundSetting{
case .enabled:
print("setting enabled")
case .disabled:
print("setting has been disabled")
case .notSupported:
print("somethings wrong here")
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.