iOS8中Parse推送通知没有声音

4

我在向iOS8设备发送推送通知时遇到了问题。一切正常工作,但推送通知不会响铃,只会出现在屏幕上。

我通过仪表板发送普通推送通知,默认启用声音。我在 iPhone4(iOS 7.1.2)、iPhone5(iOS 7.0.4)上进行测试,一切正常,但 iPhone 上的 iOS 8 没有声音。

谢谢

编辑:

1)我们已经修改了代码以处理 iOS 8 的推送通知注册更改。以下是代码片段:

// 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 { // 在 iOS 8 之前注册推送通知 [application registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; }

2)更改任何和所有配置设置也没有帮助,重启设备也没有用。


可能是通过Parse发送推送通知时没有声音的重复问题。 - James Webster
2个回答

8

看起来您需要在请求JSON中添加以下内容:"sound": "default"。以前可以使用空白,但现在需要使用“default”才能使用默认声音。


0

iOS 8中推送注册方法已更改。请检查以下可能性:

1)检查您是否使用声音注册推送通知,如this link

2)另一个可能性是通知中心中的声音可能已关闭。在“设置”中检查-->“通知中心”-->点击应用程序并启用声音。


请查看我们的编辑。我们正在遵循Parse的建议:https://www.parse.com/apps/quickstart#parse_push/ios/existing - Qaiser Iqbal

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接