在IOS 8解析推没有声音 [英] No Sound in ios 8 Parse push
问题描述
这是奇怪的,更新我的应用程序,支持通过iOS版发送解析(使用解析仪表板)的推送通知,不会发出任何声音8推送通知后。
This is weird, after updating my app to support iOS 8 push notifications sent through Parse (using the Parse dashboard) the push notifications wont make any sound.
我发现这个duplicatie#2,但贴不工作了我的答案:的没有声音在解析推送通知的iOS8上
I found this duplicatie on Stackoverflow but the answer posted wasn't working for me: No sound in Parse push notification for ios8
- 我已经检查了通知中心和信息和声音已启用。
- 创建一个新的干净的构建应用程序的
- 如果其他推送消息令上的应用程序的声音经过
- 用于解析REST API和声音设置为默认值。
我试过工作的事情没有。
None of the things I tried worked.
更新使用解析code我的应用程序:
Updated my app using the Parse code:
// 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上开发的excisting bug报告: https://developers.facebook.com /错误/ 719233564823090 /
推荐答案
您可以以JSON格式发送推送通知,而不是像这样的Web控制台文本格式:
You can send your push notifications in JSON format rather than the text format in the web console like so:
{"aps":{"alert":"This is a Test","sound":"default"}}
这是一个解决方法,直到解析修复这个bug。
It's a workaround until Parse fixes this bug.
这篇关于在IOS 8解析推没有声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!