Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No Sound in ios 8 Parse push [duplicate]

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.

I found this duplicatie on Stackoverflow but the answer posted wasn't working for me: No sound in Parse push notification for ios8

  • I already checked the notification center and messages and sounds are enabled.
  • Created a new clean build of the app
  • Checked if other push messages make sounds on the app
  • Used the Parse rest api and set the sound to default.

None of the things I tried worked.

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)];
}

EDIT: I found an excisting bug report on Facebook dev: https://developers.facebook.com/bugs/719233564823090/

like image 747
Andrew Ho Avatar asked Oct 21 '14 13:10

Andrew Ho


1 Answers

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"}}

It's a workaround until Parse fixes this bug.

like image 103
Paul Avatar answered Sep 28 '22 04:09

Paul