问题描述
我遇到了向 iOS8 设备推送通知的问题.一切正常,但推送没有响起,只出现在屏幕上.我通过仪表板发送正常推送,其中默认启用声音.我在 iPhone4 (iOS 7.1.2)、iPhone5 (iOS 7.0.4) 上测试过,它工作正常,但在装有 iOS 8 的 iPhone 上没有声音.谢谢
I'm having as issue with Push Notification to iOS8 device. Everything works fine, but the push is not ringing, only appears on the screen.I am sending normal pushes via dashboard, in which sound is enabled by default. I tested on iPhone4 (iOS 7.1.2), iPhone5 (iOS 7.0.4), it works fine, but there is no sound on iPhone with iOS 8.Thanks
1) 我们已经修改了我们的代码来处理 ios8 的更改推送通知注册.下面是代码片段:
1) We have already modified our code to handle changes push notification registration for ios8. Below is the code snippet:
//注册推送通知,如果运行的是 iOS 8如果([应用程序响应选择器:@选择器(注册用户通知设置:)]){UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |UIUserNotificationTypeBadge |UIUserNotificationTypeSound);UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes Categories:nil];[应用注册用户通知设置:设置];[应用 registerForRemoteNotifications];} 别的 {//在 iOS 8 之前注册推送通知[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];}
2) 更改任何和所有配置设置也无济于事,重启设备也无济于事.
2) Changing any and all configuration settings doesn't helped either, nor does restarting the device.
推荐答案
似乎您在请求 JSON 中需要这个:"sound": "default"
.Blank 过去可以工作,但现在需要default"才能使用默认声音.
Seems like you need this in the request JSON: "sound": "default"
. Blank used to work, but now needs "default" to use the default sound.
这篇关于ios8 的 Parse 推送通知中没有声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!