我已經成功地安排使用下面的代碼在我的應用程序的本地通知聲音:設置爲在3G版iPhone本地通知運行iOS4的
Class cls = NSClassFromString(@"UILocalNotification");
if (cls != nil) {
UILocalNotification *notification = [[cls alloc] init];
notification.fireDate = self.alarmNotificationDate;
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.alertBody = @"Alarm is due";
notification.alertAction = @"Show Alarm";
notification.soundName = @"alarm.mp3";
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
[notification release];
凡self.alarmNotificationDate是在NSDate的另一種方法分配。
所有在模擬器中工作正常,但是當我測試運行iOS4的可信任舊iPhone 3G時,我收到通知,但僅使用默認聲音。
我嘗試過不同的聲音文件,但沒有成功。
任何線索爲什麼它可能是這樣以及如何糾正它?
感謝
謝謝。現在使用AIF文件。 – Structurer 2010-09-30 02:46:48