{"action":"created","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/17","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/17/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/17/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/17","id":89427196,"number":17,"title":"Custom notification sound in background mode?","user":{"login":"sebrojas14","id":1771574,"avatar_url":"https://avatars.githubusercontent.com/u/1771574?v=3","gravatar_id":"","url":"https://api.github.com/users/sebrojas14","html_url":"https://github.com/sebrojas14","followers_url":"https://api.github.com/users/sebrojas14/followers","following_url":"https://api.github.com/users/sebrojas14/following{/other_user}","gists_url":"https://api.github.com/users/sebrojas14/gists{/gist_id}","starred_url":"https://api.github.com/users/sebrojas14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebrojas14/subscriptions","organizations_url":"https://api.github.com/users/sebrojas14/orgs","repos_url":"https://api.github.com/users/sebrojas14/repos","events_url":"https://api.github.com/users/sebrojas14/events{/privacy}","received_events_url":"https://api.github.com/users/sebrojas14/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/milestones/1","html_url":"https://github.com/phonegap/phonegap-plugin-push/milestones/Release%201.1.0","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/milestones/1/labels","id":1184021,"number":1,"title":"Release 1.1.0","description":"","creator":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":6,"state":"closed","created_at":"2015-06-28T02:30:57Z","updated_at":"2015-08-16T18:02:54Z","due_on":null,"closed_at":"2015-08-16T18:02:54Z"},"comments":19,"created_at":"2015-06-18T23:56:47Z","updated_at":"2015-09-10T15:16:51Z","closed_at":"2015-07-24T21:56:48Z","body":"Why I can't the app play a custom sound with the notification when is in background? I'm sending the sound name in the notification...I neither can make this to work in the previous version of the plugin.\r\n\r\nI have beep.wav in my www folder. For Android I'm sending 'soundname': 'beep.wav' in the payload, and 'sound': 'beep.wav' for iOS\r\n\r\nMy code:\r\n\r\nApp:\r\n\r\n    var push = PushNotification.init({\r\n        \"android\": {\r\n            \"senderID\": \"...\"//I put here my GCM senrder id\r\n        },\r\n        \"ios\": {}\r\n    });\r\n\r\n    push.on('registration', function(data) {\r\n        // data.registrationId\r\n        registerNotificationToken(data.registrationId, (window.device.platform == 'android' || device.platform == 'Android') ? 'Android' : 'iOS');\r\n    });\r\n\r\n    push.on('notification', function(data) {\r\n        // data.message,\r\n        // data.title,\r\n        // data.count,\r\n        // data.sound,\r\n        // data.additionalData\r\n        if (isLogedIn()) {\r\n            \r\n            if (window.device.platform == 'android' || device.platform == 'Android') {\r\n                \r\n                // if this flag is set, this notification happened while we were in the foreground.\r\n                // you might want to play a sound to get the user's attention, throw up a dialog, etc.\r\n                if ( data.additionalData.foreground )\r\n                {\r\n                    var my_media = new Media(\"/android_asset/www/\" + data.sound);\r\n                    my_media.play();\r\n    \r\n                    alertify.confirm('<p><strong>' + data.title + '</strong><p/><p>' + data.message + '</p><p>¿Desea verlo?</p>', function () {\r\n    \r\n                        location.hash = 'available-services\\\\' + data.additionalData.id;\r\n                    });\r\n                }\r\n                // otherwise we were launched because the user touched a notification in the notification tray.\r\n                else {   \r\n                    //If app wasn't runing\r\n                    if ( e.coldstart ) {\r\n    \r\n                        serviceId = data.additionalData.id;\r\n                    }\r\n                    else {\r\n    \r\n                        location.hash = 'available-services\\\\' + data.additionalData.id;\r\n                    }\r\n                }\r\n            }\r\n            else {\r\n                \r\n                if ( data.additionalData.alert ) {\r\n                    \r\n                    //do something with the push message. This function is fired when push message is received or if user clicks on the tile.\r\n                    if (data.additionalData.foreground == 1) {\r\n                        \r\n                        alertify.confirm('<p><strong>' + data.title+ '</strong><p/><p>' + data.message + '</p><p>¿Desea verlo?</p>', function () {\r\n                                         \r\n                            location.hash = 'available-services\\\\' + data.additionalData.id;\r\n                        });\r\n                    }\r\n                    else {\r\n                        \r\n                        location.hash = 'available-services\\\\' + data.additionalData.id;\r\n                    }\r\n                }\r\n            \r\n                if ( data.sound ) {\r\n                    \r\n                    //play notification sound. Ignore when app is in foreground.\r\n                    var snd = new Media(data.sound);\r\n                    snd.play();\r\n                }\r\n            }\r\n        }\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/comments/139276705","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/17#issuecomment-139276705","issue_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/17","id":139276705,"user":{"login":"macdonst","id":353180,"avatar_url":"https://avatars.githubusercontent.com/u/353180?v=3","gravatar_id":"","url":"https://api.github.com/users/macdonst","html_url":"https://github.com/macdonst","followers_url":"https://api.github.com/users/macdonst/followers","following_url":"https://api.github.com/users/macdonst/following{/other_user}","gists_url":"https://api.github.com/users/macdonst/gists{/gist_id}","starred_url":"https://api.github.com/users/macdonst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macdonst/subscriptions","organizations_url":"https://api.github.com/users/macdonst/orgs","repos_url":"https://api.github.com/users/macdonst/repos","events_url":"https://api.github.com/users/macdonst/events{/privacy}","received_events_url":"https://api.github.com/users/macdonst/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T15:16:51Z","updated_at":"2015-09-10T15:16:51Z","body":"@alexislg2 It would be `/platforms/ios`. If you see the above comment you are supposed to supply an extension. Also, .mp3 may not work. Check the https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6 link for information on what file types iOS supports."}}