Ir al contenido principal

Entradas

Mostrando las entradas de diciembre, 2013

iOS - Notificaciones locales en determinado tiempo.

Ahora les voy a compartir unas lineas de codigo para poder crear alertas/notificaciones locales desde una aplicacion en iOS: // Creamos el objecto de la notificación UILocalNotification *notification = [[UILocalNotification alloc] init] ; // Fecha/Tiempo en el que se lanzara la notificación notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:60]; // TimeZone notification.timeZone = [NSTimeZone localTimeZone]; // Mensaje de la notificación notification.alertBody = [NSString stringWithFormat: @"Mensaje interesante!"]; // Puedes pasar adicionalmente un Diccionario con valores. notification.userInfo= [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"Some info"] forKey:@"information"]; // Posibilidad de repetir la notificacion // notification.repeatInterval= NSCalendarUnitDay; // Sonido de la notificacion notification.soundName = UILocalNotificationDefaultSou