UNNotificationSound not playing custom sound

I can't seem to get custom sounds to play on iOS 10, even though the same sounds played on iOS 9 using the old APIs

UNMutableNotificationContent *content = [[UNMutableNotificationContent alloc] init];
content.body = ...
content.categoryIdentifier = ...
content.userInfo = ...
content.badge = ...
UNNotificationSound *bell = [UNNotificationSound soundNamed:soundName];
content.sound = bell;
UNTimeIntervalNotificationTrigger *trigger = [UNTimeIntervalNotificationTrigger triggerWithTimeInterval:[date timeIntervalSinceNow] repeats:NO];
UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:[[NSUUID UUID] UUIDString] content:content trigger:trigger];
[[UNUserNotificationCenter currentNotificationCenter] addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
    NSLog(@"error scheduling %@", error);
}];


I haven't seen an reference to there being an issue in the release notes. Anyone else having this issue?

Accepted Reply

UNNotificationSound is available on watchOS, but the soundNamed: method is iOS-only: https://developer.apple.com/reference/usernotifications/unnotificationsound/1649031-soundnamed?language=objc So on watchOS, defaultSound is the only option.

Replies

We have the same issue even on 10.3. We urgently need a fix or a workaround. Is there a bug report for this issue?