Last active
September 19, 2016 16:48
-
-
Save RameshAran/38b350482b848ba88bc08c8de2998488 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let content = UNMutableNotificationContent() | |
content.title = NSString.localizedUserNotificationString(forKey: "Hello!", arguments: nil) | |
content.body = NSString.localizedUserNotificationString(forKey: "Hello_message_body", arguments: nil) | |
content.sound = UNNotificationSound.default() | |
// Deliver the notification in five seconds. | |
let trigger = UNTimeIntervalNotificationTrigger.init(timeInterval: 5, repeats: false) | |
let request = UNNotificationRequest.init(identifier: "notification_sample_2", content: content, trigger: trigger) | |
// Schedule the notification. | |
let center = UNUserNotificationCenter.current() | |
center.add(request) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating a simple local notification in Swift