这很奇怪,更新我的应用程序以支持通过 Parse(使用 Parse 仪表板)发送的 iOS 8 推送通知后,推送通知不会发出任何声音。
我在 Stackoverflow 上发现了这个重复项,但发布的答案对我不起作用:ios8 的 Parse 推送通知没有声音 https://stackoverflow.com/questions/26424478/no-sound-in-parse-push-notification-for-ios8
- 我已经检查了通知中心并且消息和声音已启用。
- 创建了应用程序的新的干净版本
- 检查其他推送消息是否在应用程序上发出声音
- 使用 Parse rest api 并将声音设置为默认值。
我尝试过的所有方法都不起作用。
使用解析代码更新了我的应用程序:
// Register for Push Notitications, if running iOS 8
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
} else {
// Register for Push Notifications before iOS 8
[application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeSound)];
}
编辑:我在 Facebook 开发人员上发现了一份现有的错误报告:https://developers.facebook.com/bugs/719233564823090/ https://developers.facebook.com/bugs/719233564823090/
您可以在 Web 控制台中以 JSON 格式而不是文本格式发送推送通知,如下所示:
{"aps":{"alert":"This is a Test","sound":"default"}}
在 Parse 修复此错误之前,这是一个解决方法。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)