Qualcuno può dirmi come ottenere un UILocalNotification
mentre la mia app è in background.Notifica locale in background
Sto postando il mio codice qui. Grazie in anticipo.
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate =[startDate addTimeInterval:60];
NSLog(@"%@",localNotif.fireDate);
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertAction = @"View";
localNotif.soundName = UILocalNotificationDefaultSoundName;
NSString *notifStr=[NSString stringWithFormat:@"Hey looks like you're meeting up with %@, why don't you let your other friends know what fun they're missing out on? Share a photo :)",[itemDict objectForKey:@"fname"]];
NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:notifStr ,@"notifKey",nil];
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
Cosa intendi per "ricevere notifiche locali mentre l'app è in background"? Se pianifichi una notifica locale e questa viene attivata mentre la tua app è in background, l'utente vedrà una vista di avviso ma il gioco è fatto. Non puoi ricevere un messaggio che ti informa che la notifica locale è stata attivata! – Dabrut
BUt nel mio caso non viene licenziato. non so perché? –
Quale è il valore di startDate? Prova [NSDate dateWithTimeIntervalSinceNow: 60] e rimuovendo il fuso orario – Dabrut