我創建一個UNNotificationRequest與UNNotificationSound爲使用文件的.caf我有一個藍色的文件夾:如何獲得UNNotificationSound在我的項目
content.sound = UNNotificationSound(named: "alarmSounds/alarmAscending.caf")
聲音是在文件夾(藍色)alarmSounds在主項目文件夾中。
使用的聲音始終是默認聲音,而不是我的聲音。我也嘗試過,沒有在「named:」參數中的「alarmSound /」,但仍然無法工作。
有什麼特別的我需要做的聲音文件?
這是使用xcode 9並在iOS 11設備上嘗試它。
確保放置在項目包中的聲音文件。 –