【发布时间】:2014-12-16 18:27:27
【问题描述】:
这很奇怪,在更新我的应用程序以支持通过 Parse 发送的 iOS 8 推送通知(使用 Parse 仪表板)后,推送通知不会发出任何声音。
我在 Stackoverflow 上找到了这个副本,但发布的答案对我不起作用:No sound in Parse push notification for ios8
- 我已经检查了通知中心并且启用了消息和声音。
- 创建了应用的全新干净版本
- 检查其他推送消息是否在应用程序上发出声音
- 使用 Parse rest api 并将声音设置为默认值。
我尝试过的所有方法都不起作用。
使用 Parse 代码更新了我的应用:
// 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/
【问题讨论】:
-
我遇到了同样的问题。我在 iOS 8 之前发布的所有应用程序在调用时都没有激活 UIRemoteNotificationTypeSound。
-
在下一次 SDK 更新中提供了一个修复程序。
标签: ios xcode push-notification parse-platform apple-push-notifications