Skip to content

Instantly share code, notes, and snippets.

@suraphanL
Created September 11, 2016 17:45
Show Gist options
  • Save suraphanL/5f1e21b66124cef03b93c5fb342d36c5 to your computer and use it in GitHub Desktop.
Save suraphanL/5f1e21b66124cef03b93c5fb342d36c5 to your computer and use it in GitHub Desktop.
let gameScoreIdentifier = "game1.score.identifier"
let gameScoreRequest = UNNotificationRequest(identifier: gameScoreIdentifier,
content: scoreContent,
trigger: trigger)
UNUserNotificationCenter.current().add(gameScoreRequest) { (error) in // ... }
// Wrong game score was published
UNUserNotificationCenter.current()
.removeDeliveredNotifications(withIdentifiers: [gameScoreIdentifier])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment