og82pw
Last Updated: February 25, 2016
·
937
· novalagung
16162fed91387cc1cec055412db0022d

iOS - Simple local notification Example

UILocalNotification *notification = [[UILocalNotification alloc] init];
if (notification) {
    notification.fireDate = [NSDate date];
    notification.timeZone = [NSTimeZone defaultTimeZone];
    notification.repeatInterval = 0;
    notification.soundName = UILocalNotificationDefaultSoundName;
    notification.alertBody = @"Notification Message";
    notification.applicationIconBadgeNumber = [UIApplication sharedApplication].applicationIconBadgeNumber + 1;
    notification.userInfo = @{@"data" : @1};

    [[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
Say Thanks
Respond