Note that there are some explanatory texts on larger screens.

plurals
  1. POLocalNotifiction for wakeup application
    primarykey
    data
    text
    <p>In my application i want to set local notifiaction on a particular time if my application killed from background else if my application in running condition then i dan't want to show localnotification </p> <p>I have written code for local notification </p> <pre><code>NSCalendar *calendar1 = [NSCalendar autoupdatingCurrentCalendar]; // Get the current date NSDate *pickerDate1 =self.dateEvening;//[self.dateEvening dateByAddingTimeInterval:60*1];// [self.pickerView date]; // Break the date up into components NSDateComponents *dateComponents1 = [calendar1 components:( NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit ) fromDate:pickerDate1]; NSDateComponents *timeComponents1 = [calendar1 components:( NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit ) fromDate:pickerDate1]; NSDateComponents *dateComps1 = [[NSDateComponents alloc] init]; [dateComps1 setDay:[dateComponents1 day]]; [dateComps1 setMonth:[dateComponents1 month]]; [dateComps1 setYear:[dateComponents1 year]]; [dateComps1 setHour:[timeComponents1 hour]]; [dateComps1 setMinute:[timeComponents1 minute]]; [dateComps1 setSecond:[timeComponents1 second]]; NSDate *itemDate1 = [calendar1 dateFromComponents:dateComps1]; [dateComps1 release]; UILocalNotification *localNotif1 = [[UILocalNotification alloc] init]; if (localNotif1 == nil) return; localNotif1.fireDate = itemDate1; localNotif1.timeZone = [NSTimeZone defaultTimeZone]; localNotif1.alertBody = @"Open application"; localNotif1.alertAction = @"View"; localNotif1.soundName = UILocalNotificationDefaultSoundName; [[UIApplication sharedApplication] scheduleLocalNotification:localNotif1]; [localNotif1 release]; </code></pre> <p>Above code works fine if application will close from background but if my application in running condition then I don't want local notifications to be fired.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload