Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios10 custom push notification sound not playing

Tags:

I am currently running iOS 10 beta 8 with Xcode 8.0 beta 6 and the custom sound does not play when I receive a push notification with the correct payload.

I have verified the payload and it is in the correct format per the apple documentation:

{     "aps" : {         "alert" : "You got your emails.",         "badge" : 9,         "sound" : "bingbong.aiff"     },     "acme1" : "bar",     "acme2" : 42 } 

When I send the same payload to the same build on iOS9 the custom sound plays properly.

Does anyone know if there are any other changes in iOS 10 that I need to make?

like image 392
David Truong Avatar asked Sep 08 '16 21:09

David Truong


People also ask

Why do I get notification but no sound?

Go to Settings. Select Sounds and Vibration. Tap Volume. Adjust the notifications slider to where you want it.

Can push notifications have sound?

On Android devices, it is possible to choose individual push notification sounds.

Why don't I get sound notifications on my iPhone?

settings -> notifications -> (relevant app) -> customise notifications. ensure each account you want to have make a sound has alerts enabled. It has taken me days to get to this!


2 Answers

This problem seems to only affect apps installed via Xcode. The issue persists even if you later update the app from a different source.

The solution is to completely remove the app, and reinstall it from TestFlight or the App Store.

In effect, this bug should not affect your end users.

Edit 2016-10-15:

Unfortunately it seems that I was mistaken. This appears to be a bug on iOS 10 that can, in fact, affect App Store apps also. If it is of any consolation, apps such as Facebook and WhatsApp are affected too. The solution is apparently to force restart your phone, but unfortunately there doesn't seem to be much we can do about it as developers.

Apple Fixed Issue:

Based on this comment, Apple has seemed to fix the issue in iOS 10.2

like image 124
mhalttu Avatar answered Sep 21 '22 17:09

mhalttu


Try installing your app using Test Flight and after implementing initial process to update device token just restart your device.

You'll get what you have been looking for.

Credit goes to - binncheol

like image 22
Rahul Verma Avatar answered Sep 21 '22 17:09

Rahul Verma