Last active
September 19, 2016 16:45
-
-
Save RameshAran/6bebf3fb61c73ac4f8b012253756b937 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
UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; | |
content.title = [NSString localizedUserNotificationStringForKey:@"Hello!" | |
arguments:nil]; | |
content.body = [NSString localizedUserNotificationStringForKey:@"Hello_message_body" | |
arguments:nil]; | |
content.sound = [UNNotificationSound defaultSound]; | |
UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:5 | |
repeats:NO]; | |
UNNotificationRequest *notificationRequest = [UNNotificationRequest requestWithIdentifier:kNotificationIdentifier | |
content:content | |
trigger:trigger]; | |
UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter]; | |
[center addNotificationRequest:notificationRequest | |
withCompletionHandler:^(NSError * _Nullable error) { | |
NSLog(@"completed!"); | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creating a simple local notification in Objective C