我在向 iOS8 设备推送通知时遇到问题。一切正常,但推送没有响铃,只出现在屏幕上。
我通过仪表板发送正常推送,默认情况下启用声音。我在iPhone4(iOS 7.1.2)、iPhone5(iOS 7.0.4)上测试,工作正常,但在iOS 8的iPhone上没有声音。
谢谢
edit:
1) 我们已经修改了代码来处理 ios8 的更改推送通知注册。下面是代码片段:
// 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)];
}
2)更改任何和所有配置设置都没有帮助,重新启动设备也没有帮助。
看来您在请求 JSON 中需要以下内容:"sound": "default"
。空白过去可以工作,但现在需要“默认”才能使用默认声音。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)