ios10 custom push notification sound not playing

杀马特。学长 韩版系。学妹 提交于 2019-11-28 19:05:37

问题


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?


回答1:


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




回答2:


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




回答3:


Having our user restart their device is correcting the issue for us.

This is an issue for us regardless of how the app was installed (TestFlight or from the app store).




回答4:


There is definitely an iOS10 bug which still persists as of 10.0.2. It affects many apps including popular ones such as Whatsapp and Messenger. The workaround is just to power cycle the device, after which point the notification sounds are correct. It doesn't seem to matter how the app is installed.

I can't find any documentation of this from Apple (go figure) but there is more info here: http://thetechbeard.com/how-to-fix-notification-sound-problem-in-ios-10/.

As reported here lots of other people are having this problem. Hopefully Apple fixes it soon.



来源:https://stackoverflow.com/questions/39400703/ios10-custom-push-notification-sound-not-playing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!