Initial importieren wir den UserNotifications
Rahmen und wir initialisieren die delegierte Methode in AppDelegate.swift
KlassePush-Benachrichtigung funktioniert nicht in schnellen 3,0
if #available(iOS 10.0, *){
UNUserNotificationCenter.current().delegate = self
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options:[.badge, .alert, .sound]) { (granted, error) in
if (granted)
{
UIApplication.shared.registerForRemoteNotifications()
}
else{
//Do stuff if unsuccessful...
}
// Enable or disable features based on authorization.
}
}
Haben Sie überprüfen, ob http://stackoverflow.com/questions/41035878/how- can-i-store-push-notification-alarmmeldung-in-userdefault/41037919 # 41037919 – Amanpreet