草庐IT

UILocalNotification

全部标签

iphone - 本地通知 "didReceiveLocalNotification"调用两次

我正在使用以下方式处理本地通知:-(void)application:(UIApplication*)appdidReceiveLocalNotification:(UILocalNotification*)notif并安排本地通知:-(void)scheduleNotificationWithInterval:(int)minutesBefore{UILocalNotification*localNotif=[[UILocalNotificationalloc]init];if(localNotif==nil)return;NSDate*fireDate=[NSDatedate];l

ios - 请求用户允许在触发本地通知时显示警报

我想在触发本地通知时显示警报,但为此我必须请求许可,正如我在iPhone上运行该应用程序时对我说的那样:Attemptingtoschedulealocalnotification{firedate=Friday13June201412h10min27sCentralEuropeanSummerTime,timezone=(null),repeatinterval=0,repeatcount=UILocalNotificationInfiniteRepeatCount,nextfiredate=Friday13June201412h10min27sCentralEuropeanSumm

ios - 请求用户允许在触发本地通知时显示警报

我想在触发本地通知时显示警报,但为此我必须请求许可,正如我在iPhone上运行该应用程序时对我说的那样:Attemptingtoschedulealocalnotification{firedate=Friday13June201412h10min27sCentralEuropeanSummerTime,timezone=(null),repeatinterval=0,repeatcount=UILocalNotificationInfiniteRepeatCount,nextfiredate=Friday13June201412h10min27sCentralEuropeanSumm

ios - 如何在 iOS 中监听通知关闭事件?

我正在监听为我的本地通知按下的操作,但是有没有办法确定用户何时关闭通知?以下是我如何在我的AppDelegate中监听我的操作,但解雇并没有触发:funcapplication(application:UIApplication,handleActionWithIdentifieridentifier:String?,forLocalNotificationnotification:UILocalNotification,completionHandler:()->Void){varactionName:String?=nilifletidentifier=identifier{swi

ios - 如何在 iOS 中监听通知关闭事件?

我正在监听为我的本地通知按下的操作,但是有没有办法确定用户何时关闭通知?以下是我如何在我的AppDelegate中监听我的操作,但解雇并没有触发:funcapplication(application:UIApplication,handleActionWithIdentifieridentifier:String?,forLocalNotificationnotification:UILocalNotification,completionHandler:()->Void){varactionName:String?=nilifletidentifier=identifier{swi

iphone - UILocalNotification 自定义声音不在 iOS7 中播放

我在应用程序中使用UILocalNotification。在应用程序中有两种有条件地播放的声音-我已经为它们应用了适当的条件。但是当我安装应用程序并在iOS7设备上运行它时,它会触发本地通知,但应用程序中没有播放声音。下面给出了设置通知的代码:UILocalNotification*localNotification=[[UILocalNotificationalloc]init];if(localNotification==nil)return;localNotification.fireDate=[pickerViewdate];localNotification.timeZone

iphone - UILocalNotification 自定义声音不在 iOS7 中播放

我在应用程序中使用UILocalNotification。在应用程序中有两种有条件地播放的声音-我已经为它们应用了适当的条件。但是当我安装应用程序并在iOS7设备上运行它时,它会触发本地通知,但应用程序中没有播放声音。下面给出了设置通知的代码:UILocalNotification*localNotification=[[UILocalNotificationalloc]init];if(localNotification==nil)return;localNotification.fireDate=[pickerViewdate];localNotification.timeZone

ios - 有没有一种简单的方法来编辑/修改 UILocalNotification

是否有更简单的方法来编辑,例如,已安排的UILocalNotification的alertBody属性?现在,我只是取消通知并安排一个新通知,但是当应用需要为3个或更多通知执行此操作时,执行需要很长时间... 最佳答案 如果文档是正确的,您就不能更改已经安排好的通知。-scheduleLocalNotification:的文档说明:[…]Becausetheoperatingsystemcopiesnotification,youmayreleaseitonceyouhavescheduledit.通知对象由系统复制,不能通过任何(

ios - 有没有一种简单的方法来编辑/修改 UILocalNotification

是否有更简单的方法来编辑,例如,已安排的UILocalNotification的alertBody属性?现在,我只是取消通知并安排一个新通知,但是当应用需要为3个或更多通知执行此操作时,执行需要很长时间... 最佳答案 如果文档是正确的,您就不能更改已经安排好的通知。-scheduleLocalNotification:的文档说明:[…]Becausetheoperatingsystemcopiesnotification,youmayreleaseitonceyouhavescheduledit.通知对象由系统复制,不能通过任何(

ios - UILocalNotification 根本不起作用

我在使用UILocalNotification时遇到了一些非常恼人的问题。在完成我即将完成的应用程序时,我注意到无论我尝试什么,我都无法让本地通知正常工作。因此,我没有浪费时间,而是决定回到基础,看看我是否能让它们发挥作用。我创建了一个新的基于XCodeView的应用程序,并将-viewDidLoad替换为:-(void)viewDidLoad{UILocalNotification*theNotification=[[UILocalNotificationalloc]init];theNotification.alertBody=@"Alerttext";theNotificatio