Closed JoeyBodnar closed 5 years ago
@JoeyBodnar, I have included a notificationSoundName
property in the SDK. Please go through the documentation for integration notes.
I have tried that method but it doesn't seem to be working. No sound is played. This is my code:
if let url = Bundle.main.url(forResource: "notification", withExtension: "mp3") {
nearBee.notificationSound = UNNotificationSoundName(rawValue: url.lastPathComponent)
}
and here is the location of the mp3 file in my project tree:
Also, I tested with local notifications (custom notifications I can create using UNMutableNotificationContent
, and the sound did work for me. But it doesn't with the actual notifications from NearBee.
Hi @JoeyBodnar, Please enable the sound by set UserDefaults.standard.setValue(true, forKey: "NearBeeToggleSound")
I am looking into adding a sound to when the notification is received. From what I can see, it looks like this must be added on the sending end of the notification when creating an instance of
UNMutableNotificationContent
(https://developer.apple.com/documentation/usernotifications/unmutablenotificationcontent)Is there currently a sound being specified? If not is there some way to add that ability? See also https://stackoverflow.com/questions/42318209/swift-unusernotification-does-not-trigger-sound