1
每當我創建一個UILocalNotification並且它被觸發時,我只能每隔一秒播放一次自定義聲音。這隻發生在模擬器之外,在我的iPhone 5s上。UILocalNotification聲音每隔一段時間播放
UILocalNotification* sessionEndNotification = [UILocalNotification new];
sessionEndNotification.fireDate = [self.dateAppMinimized dateByAddingTimeInterval:[self secondsLeft]];
sessionEndNotification.alertBody = @"Your session has finished. Remember to remain mindful through the rest of your day!";
sessionEndNotification.soundName = @"bell.caf";
[[UIApplication sharedApplication] scheduleLocalNotification:sessionEndNotification];
如果我將soundName更改爲UILocalNotificationDefaultSoundName,它每次都有效。 bell.caf長8秒。
我在做什麼錯?
謝謝!
您能指定更多詳細信息嗎?這並不清楚。 – KChen
基本上,每次部署通知時(電話被鎖定時)聲音都不播放,並且不會振動。所以它工作一半時間。如果我使用默認聲音名稱,則每次都有效。 – MaitlandMarshall