3

custom sound not working in unnotificationrequest - iOS 10

I tried :

[UNNotificationSound soundNamed:@"Alarm.mp3"]

or

[UNNotificationSound soundNamed:@"Alarm"]

and the file is exist in bundle or Library/Sounds but always played default sound when app is in background. is anybody know why?

Community
  • 1
  • 1
Mohammad
  • 141
  • 1
  • 7

1 Answers1

3

It appears there's a bug in iOS 10. If you delete your app from the iPhone or Simulator and install fresh, your custom sounds should work fine. It's only when you re-run the app from Xcode do the custom sounds stop working.

It also appears that updates to an app through TestFlight/HockeyApp and presumably from the App Store itself will break the custom sounds. I'd count on Apple fixing this in future releases.

There's a conversation about this bug on the Apple Developer Forums, and multiple radars have been filed.

Brent Traut
  • 5,614
  • 6
  • 29
  • 54
  • 1
    This also seems to applies to token recognition. I have to delete my ios10-based test device app every single time i debug in order for it to process notifs properly. If i don't, i see "completely unknown token" errors. Radar: 28789788 {which is getting NO love at all..} – drew.. Nov 08 '16 at 17:06
  • 1
    so basically the real users won't have any problem and this is just a development problem? Also which ones does it have to be? alarm.aiff/caf or just alarm? – mfaani Feb 21 '17 at 20:02