如何使用UNNotificationSettings
在iOS 10中获取通知类型?
在以前的iOS上,我会使用它:
UIUserNotificationSettings *notificationSettings = [[UIApplication sharedApplication] currentUserNotificationSettings];
Bool active = notificationSettings.types == UIUserNotificationTypeNone ? NO: YES;
答案 0 :(得分:7)
我希望你问这个
if (document.ThumbnailPart == null)
document.AddThumbnailPart(ThumbnailPartType.Jpeg);
var thumbNailPart = document.ThumbnailPart;
Swift 4
UNUserNotificationCenter.currentNotificationCenter().getNotificationSettingsWithCompletionHandler{ (mySettings) in mySettings.alertStyle == .None }
对于Objective-C
UNUserNotificationCenter.current().getNotificationSettings{ (mySettings) in mySettings.alertStyle == .none }