I have written the following code for displaying local notifications.However,a button is not showing up on the notifications when i receive them.Can anybody tell me what I am doing wrong?
I have written the following piece of code in application did enter background event.
UILocalNotification *local=[[UILocalNotification alloc]init];
NSDate *alertTime = [[NSDate date] dateByAddingTimeInterval:10];
local.fireDate=alertTime;
local.timeZone=[NSTimeZone defaultTimeZone];
local.alertBody=@"Hello this is a local notif";
local.alertAction=@"Show";
local.repeatInterval=0;
local.applicationIconBadgeNumber=1;
local.soundName=UILocalNotificationDefaultSoundName;
UIApplication *abc=[UIApplication sharedApplication];
[abc scheduleLocalNotification:local];
You have to write your code in AppDelegate.m File in below method.