在 iPhone 应用程序中,
我正在设置本地通知。
我正在设置自定义声音。
当通知到来时,我无法“听到”任何声音。甚至没有默认声音。
在我的 iPod touch 和我的设备中都没有。
任何机构可以帮助我找出原因?
非常感谢。
这是代码。
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate=[dateFormat dateFromString:alarm_date];
localNotification.alertBody = @"Alarm.";
localNotification.soundName = [filePath lastPathComponent];
//localNotification.soundName =soundname;
//UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = 1;
localNotification.alertAction=@"Show";
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
答案 得到了愚蠢的点:通知声音只有在您的应用程序处于后台或关闭时才会播放。对不起这个问题。不管怎样,谢谢。