var UILocalNotification = plus.ios.importClass("UILocalNotification");
var UIApplication = plus.ios.importClass("UIApplication");
//var uiApplication = UIApplication.sharedApplication();
var uiLocalNotification = new UILocalNotification();
var NSDate = plus.ios.importClass("NSDate");
var nsdate = new NSDate();
var UILocalNotificationDefaultSoundName = plus.ios.importClass("UILocalNotificationDefaultSoundName");
var NSTimeZone = plus.ios.importClass("NSTimeZone");
nsdate.initWithTimeIntervalSinceNow(0);
nsdate.dateByAddingTimeInterval(60);
uiLocalNotification.plusSetAttribute("fireDate",nsdate);
uiLocalNotification.plusSetAttribute("repeatInterval",512);
uiLocalNotification.plusSetAttribute("alertBody","test");
uiLocalNotification.plusSetAttribute("alertAction","打开");
uiLocalNotification.plusSetAttribute("applicationIconBadgeNumber",1);
uiLocalNotification.plusSetAttribute("soundName ",UILocalNotificationDefaultSoundName);
uiLocalNotification.plusSetAttribute("timeZone",NSTimeZone.defaultTimeZone());
var uiapplication = UIApplication.sharedApplication();
uiapplication.scheduleLocalNotification(uiLocalNotification);
这段代码 无法在 触发之后 的60秒 在系统通知中 通知到用户,本人对ios开发也是不熟,请大神帮忙看看~
hotter (作者)
这个方法并不能解决循环闹钟的问题啊 如果一周每天下午14:00 都需要 提示下 这个方法如何实现呢?
2016-07-04 16:53