我在向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)更改任何和所有配置设置也没有帮助,重启设备也没有用。