In ios 10 gibt es UNUserNotificationCenter
Klasse und Methode getNotificationSettingsWithCompletionHandler
was gibt Ihnen UNNotificationSettings
Objekt und Sie können überprüfen, ist Benutzer jemals für Push-Benachrichtigungen Berechtigungen gefragt.Ist es eine Möglichkeit, dies für iOS 9 und iOS 8 zu erreichen .Push-Notification nicht bestimmt
0
A
Antwort
0
Es gibt keine Art und Weise ist. Diese Funktionalität ist ab ios 10 verfügbar.
1
Sie können so etwas wie folgt verwenden:
let notificationType = UIApplication.sharedApplication().currentUserNotificationSettings()!.types
if notificationType == UIUserNotificationType.None {
// Push notifications are disabled in setting by user.
} else {
// Push notifications are enabled in setting by user.
}
if notificationType != UIUserNotificationType.None {
// Push notifications are enabled in setting by user.
}
if notificationType == UIUserNotificationType.Badge {
// the application may badge its icon upon a notification being received
}
if notificationType == UIUserNotificationType.Sound {
// the application may play a sound upon a notification being received
}
if notificationType == UIUserNotificationType.Alert {
// the application may display an alert upon a notification being received
}
Verwandte Themen
- 1. Ionic PushNotification
- 2. Pushnotification Banner nicht angezeigt - IOS9
- 3. PushNotification OneSignal Ausgabe
- 4. Swift 2.0 OneSignal .pushNotification
- 5. Uncaught ReferenceError: PushNotification ist nicht definiert
- 6. PushNotification ist nicht definiert (ng-cordova)
- 7. pushnotification nicht angezeigt, wenn App in Marshmallow
- 8. Pushnotification nicht erhalten, wenn ipa-Datei installieren
- 9. Nicht bestimmt Eigenschaft „WebUser.group_id“
- 10. React Native PushNotification onNotification-Methode
- 11. Phonegap Pushnotification + Knoten-gcm: Gruppenbenachrichtigungen
- 12. iPhone PushNotification Mehrere Male registrieren
- 13. Handler noch nicht bestimmt Fehler
- 14. Ich kann MobileFirst 8.0 nicht aufrufen. PushNotification Rest Endpoint
- 15. Ionic CordovaPushV5 Initialisierungsfehler: Variable kann nicht gefunden werden: PushNotification
- 16. Distriqt PushNotification Ereignis NOTIFICATION_SELECTED wird nicht ausgelöst (VERSION = 6)
- 17. node-gcm: senden PushNotification für alle Geräte
- 18. Token Für pushnotification ios8 vs ios7 phonegap
- 19. Ionic - Push-Benachrichtigungen - 'pushNotification' von undefined
- 20. benutzerdefinierte cordova pushNotification Wrapper Rückkehr beobachtbaren
- 21. Die Popover-Pfeilrichtung kann nicht bestimmt werden
- 22. SetTimeout funktioniert nicht wie mit CSS bestimmt
- 23. bestimmt DB2-Textstringlänge
- 24. eloquent belongsTo Beziehungstabelle bestimmt
- 25. Wie man Notenfrequenzen bestimmt?
- 26. Rectangle Kollision bestimmt Seite
- 27. Wie wird die Prozessgröße bestimmt?
- 28. Wie bestimmt GDB ARM-Architektur
- 29. in verlinkte Liste Objekttyp bestimmt
- 30. Haskell Splitliste bestimmt durch Summenwert