当前位置: 代码迷 >> Iphone >> 本地推送的有关问题
  详细解决方案

本地推送的有关问题

热度:75   发布时间:2016-04-25 06:23:44.0
本地推送的问题
小弟的代码:
UILocalNotification *notification = [[UILocalNotification alloc] init]; 
if (notification != nil) 
{  
NSDate *now = [NSDate new];  
notification.fireDate = [now dateByAddingTimeInterval:10];  
notification.timeZone = [NSTimeZone defaultTimeZone];  
notification.alertBody = @"测试";  
notification.soundName = UILocalNotificationDefaultSoundName;  
notification.applicationIconBadgeNumber = 1;  
[[UIApplication sharedApplication] scheduleLocalNotification:notification];  
[notification release]; 
}. 
现在的问题是,程序在后台时可以弹出一个推送通知,但是手机桌面上程序的icon图标数字不能改变,这是什么原因啊?



------解决方案--------------------
收到通知时再刷新一下图标?
  相关解决方案