Show alert on sceen when app is in background
I want to show multiple alerts after some time interval when the app is in
background.
Currently I am using local notification to show the alert but I cannot
detect action when user presses the cancel button of local notification.
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
return;
localNotif.fireDate = [NSDate date];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
// Notification details
localNotif.alertBody = @"This is local notification
message.";
// Set the action button
localNotif.alertAction = @"View";
localNotif.alertAction = @"Yes";
localNotif.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication]
scheduleLocalNotification:localNotif];
[localNotif release];
Is there any other way I can show alert on screen when app is in background ?
No comments:
Post a Comment