Monday, 15 April 2013

ios - Why is my local notification not launching at the desired time or at all -



ios - Why is my local notification not launching at the desired time or at all -

- (ibaction)hitalarm:(id)sender { uilocalnotification *localnotif = [[uilocalnotification alloc] init]; nsdateformatter *formatter; nsstring *datestring; formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"dd-mm-yyyy hh:mm"]; datestring = [formatter stringfromdate:_timepicker.date]; nslog(@"%@",datestring); [localnotif setfiredate:_timepicker.date]; [localnotif setrepeatinterval:nscalendarunitday]; [[uiapplication sharedapplication] schedulelocalnotification:localnotif]; nslog(@"hit button"); }

this method set alarm create local notification @ specified time. however, when time comes when should have created notification, appears did not. there no given error messages not seem deliver notification. why happening?

on ios8, must phone call [[uiapplication sharedapplication] registerusernotificationsettings:settings]; permissions display background notifications.

ios objective-c

No comments:

Post a Comment