开发者

How can we get Local Notification in iPhone

开发者 https://www.devze.com 2023-03-20 03:13 出处:网络
I want to add notification based on a开发者_Python百科 user defined time and date. How can I do that?What you need to do is explained in the fine documentation.UILocalNotification *notif = [[UILocalNo

I want to add notification based on a开发者_Python百科 user defined time and date. How can I do that?


What you need to do is explained in the fine documentation.


UILocalNotification *notif = [[UILocalNotification alloc] init];
notif.alertBody = @"HI";
[notif setFireDate:DATE];// fire the notification in ten minutes
notif.alertAction = @"View";
notif.timeZone = [NSTimeZone defaultTimeZone];
[[UIApplication sharedApplication] scheduleLocalNotification:notif];


Setup a UILocalNotification and schedule it with scheduleLocalNotification: of UIApplication.

0

精彩评论

暂无评论...
验证码 换一张
取 消