Mohammad
Mohammad

Reputation: 151

custom sound not working in unnotificationrequest ios 10 objC

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?

Upvotes: 3

Views: 1655

Answers (1)

Brent Traut
Brent Traut

Reputation: 5794

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.

Upvotes: 3

Related Questions