{"action":"closed","issue":{"url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/520","labels_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/520/labels{/name}","comments_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/520/comments","events_url":"https://api.github.com/repos/phonegap/phonegap-plugin-push/issues/520/events","html_url":"https://github.com/phonegap/phonegap-plugin-push/issues/520","id":127056058,"number":520,"title":"No sound and vibration for GCM when built with Cordova but Ok with PhoneBuild","user":{"login":"gongfan99","id":4023101,"avatar_url":"https://avatars.githubusercontent.com/u/4023101?v=3","gravatar_id":"","url":"https://api.github.com/users/gongfan99","html_url":"https://github.com/gongfan99","followers_url":"https://api.github.com/users/gongfan99/followers","following_url":"https://api.github.com/users/gongfan99/following{/other_user}","gists_url":"https://api.github.com/users/gongfan99/gists{/gist_id}","starred_url":"https://api.github.com/users/gongfan99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongfan99/subscriptions","organizations_url":"https://api.github.com/users/gongfan99/orgs","repos_url":"https://api.github.com/users/gongfan99/repos","events_url":"https://api.github.com/users/gongfan99/events{/privacy}","received_events_url":"https://api.github.com/users/gongfan99/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-16T21:58:19Z","updated_at":"2016-01-16T22:56:35Z","closed_at":"2016-01-16T22:56:35Z","body":"My phone's android version: 5.0.1\r\n\r\nPreviously when I use Phonegap Build to create android GCM app, everything works fine. When app is in background, notification shows up in shade and emit sound/vibration. Then when I click the notification in shade, the app goes to foreground and \"notification\" event is fired. All good.\r\n\r\nThen I download cordova (v 5.4.1) and android SDK (\"android-22\") to build the same app locally. The app is successfully built. When app is in background, notification shows up in shade but does NOT emit sound/vibration. When I click the notification in shade, the app goes to foreground but \"notification\" event is NOT fired.\r\n\r\nThe app's index.html is:\r\n```\r\n<!DOCTYPE html>\r\n<html>\r\n<meta http-equiv=\"Content-Security-Policy\" content=\"default-src * 'unsafe-inline'\">\r\n<body>\r\n  <p id=\"debuginfo\">Debug: ...</p>\r\n  <script src=\"cordova.js\"></script>\r\n  <script>\r\nif (window.cordova) {\r\n    document.addEventListener('deviceready', function () {\r\n        var myConsoleLog = (function(){ // show messages in \"debuginfo\" DOM element\r\n            var debuginfo = '';\r\n            return function(msg){\r\n                debuginfo = debuginfo + '<br></br> --- ' + msg;\r\n                document.getElementById(\"debuginfo\").innerHTML = debuginfo;\r\n            }\r\n        })();\r\n        var push = PushNotification.init({\r\n                android: {\r\n                        senderID: \"6xxxxxxxxxxx0\"\r\n                },\r\n                ios: {\r\n                        alert: \"true\",\r\n                        badge: \"true\",\r\n                        sound: \"true\"\r\n                },\r\n                windows: {}\r\n        });\r\n        push.on('registration', function(data) {\r\n            // data.registrationId\r\n            console.log(data.registrationId);\r\n            myConsoleLog(data.registrationId);\r\n        });\r\n        push.on('notification', function(data) {\r\n            console.log(JSON.stringify(data.additionalData));\r\n            myConsoleLog(JSON.stringify(data.additionalData));\r\n        });\r\n        push.on('error', function(e) {\r\n            // e.message\r\n            console.log(JSON.stringify(e.message));\r\n            myConsoleLog(JSON.stringify(e.message));\r\n        });\r\n    })\r\n}\r\n  </script>\r\n</body>\r\n</html>\r\n```\r\n\r\nThe config.xml is:\r\n```\r\n<?xml version='1.0' encoding='utf-8'?>\r\n<widget id=\"com.sample.MyApp2\" version=\"0.0.1\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\">\r\n    <name>MyApp2</name>\r\n    <description>\r\n        A sample Apache Cordova application that responds to the deviceready event.\r\n    </description>\r\n    <author email=\"dev@cordova.apache.org\" href=\"http://cordova.io\">\r\n        Apache Cordova Team\r\n    </author>\r\n    <content src=\"index.html\" />\r\n    <preference name=\"android-build-tool\" value=\"gradle\" />\r\n    <icon src=\"icon.png\" />\r\n    <splash src=\"splash.png\" />\r\n    <plugin name=\"cordova-plugin-vibration\" />\r\n    <plugin name=\"cordova-plugin-splashscreen\" />\r\n    <plugin name=\"cordova-plugin-media\" />\r\n    <plugin name=\"phonegap-plugin-push\" spec=\"1.5.1\" />\r\n    <plugin name=\"cordova-plugin-whitelist\" spec=\"1\" />\r\n    <access origin=\"*\" />\r\n    <allow-intent href=\"http://*/*\" />\r\n    <allow-intent href=\"https://*/*\" />\r\n    <allow-intent href=\"tel:*\" />\r\n    <allow-intent href=\"sms:*\" />\r\n    <allow-intent href=\"mailto:*\" />\r\n    <allow-intent href=\"geo:*\" />\r\n    <platform name=\"android\">\r\n        <allow-intent href=\"market:*\" />\r\n    </platform>\r\n    <platform name=\"ios\">\r\n        <allow-intent href=\"itms:*\" />\r\n        <allow-intent href=\"itms-apps:*\" />\r\n    </platform>\r\n</widget>\r\n```\r\n\r\nThe GCM payload is:\r\n```\r\n{\r\n    \"to\" : 'xxxxxxxxxxxxxx',\r\n    \"notification\" :\r\n    {\r\n        \"body\" : \"great match!\",\r\n        \"title\" : \"Notification: Portugal vs. Denmark\"\r\n    },\r\n    \"data\" :\r\n    {\r\n        \"whatData\": [{name: 'messages'}],\r\n        \"sound\": \"default\"\r\n    },\r\n}\r\n```\r\nThe only difference is \"xmlns:\" header in the config.xml. For Phonegap Build, it is \"gap=http://phonegap.com/ns/1.0\" while for cordova it is \"cdv=http://cordova.apache.org/ns/1.0\". The difference is not substantial, is it?\r\n\r\nI am speculating that my cordova environment may be different from what Phonegap Build uses. I installed cordova and android SDK yesterday so each is the latest version.\r\n\r\nWhen I look at the build log, some difference exists on some libraries' version.\r\n\r\nPhonegap Build:\r\n```\r\n:prepareComAndroidSupportSupportV132310Library\r\n:prepareComAndroidSupportSupportV42310Library\r\n:prepareComGoogleAndroidGmsPlayServicesBase810Library\r\n:prepareComGoogleAndroidGmsPlayServicesBasement810Library\r\n:prepareComGoogleAndroidGmsPlayServicesGcm810Library\r\n```\r\n\r\nMy local cordova:\r\n```\r\n:prepareComAndroidSupportSupportV132311Library UP-TO-DATE\r\n:prepareComAndroidSupportSupportV42311Library UP-TO-DATE\r\n:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE\r\n:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE\r\n:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE\r\n:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE\r\n```\r\n\r\nWhere else should I start to check? Thank you very much."}}