{"action":"created","issue":{"url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/3","labels_url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/3/comments","events_url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/3/events","html_url":"https://github.com/CaffeinaLab/GCM/issues/3","id":117224748,"number":3,"title":"Push notifications do not show on lock screen","user":{"login":"adammagana","id":641064,"avatar_url":"https://avatars.githubusercontent.com/u/641064?v=3","gravatar_id":"","url":"https://api.github.com/users/adammagana","html_url":"https://github.com/adammagana","followers_url":"https://api.github.com/users/adammagana/followers","following_url":"https://api.github.com/users/adammagana/following{/other_user}","gists_url":"https://api.github.com/users/adammagana/gists{/gist_id}","starred_url":"https://api.github.com/users/adammagana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adammagana/subscriptions","organizations_url":"https://api.github.com/users/adammagana/orgs","repos_url":"https://api.github.com/users/adammagana/repos","events_url":"https://api.github.com/users/adammagana/events{/privacy}","received_events_url":"https://api.github.com/users/adammagana/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-11-16T21:42:59Z","updated_at":"2015-11-17T20:30:38Z","closed_at":"2015-11-17T20:30:38Z","body":"## Synopsis\r\nMy test devices receive push notifications when the app is in the background (they vibrate), however, the operating system does not show a notification on the lock screen or in the notification center.\r\n\r\n## Environment\r\n* Nexus 5\r\n* Android 6\r\n* Titanium 3.5.0.GA\r\n\r\n## Code\r\n### Mobile\r\n```javascript\r\nrequire('it.caffeina.gcm').registerForPushNotifications({\r\n    senderId: 'MY-GCM-SENDER-ID',\r\n    callback: function () {\r\n        // code to handle incoming notifications goes here\r\n    },\r\n    success: function (e) {\r\n        // registration success code goes here \r\n    },\r\n    error: function () {\r\n        Ti.UI\r\n            .createAlertDialog({\r\n                message: 'Error retrieving device token.'\r\n            })\r\n            .show();\r\n    }\r\n});\r\n```\r\n### Server\r\n```php\r\n$json = '{\r\n  \"registration_ids\": [\"MY-DEVICE-ID\"],\r\n  \"data\": {\r\n    \"data\":{\r\n      \"alert\":\"ALERT\",\r\n      \"title\": \"My awesome app\",\r\n      \"sound\": \"default\",\r\n      \"vibrate\": true\r\n    }\r\n  }\r\n}';\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, 'https://android.googleapis.com/gcm/send');\r\ncurl_setopt($ch, CURLOPT_POST, true);\r\ncurl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: key=MY-API-KEY', 'Content-Type: application/json' ]);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\ncurl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\r\necho curl_exec($ch);\r\ncurl_close($ch);\r\n```"},"comment":{"url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/comments/157497756","html_url":"https://github.com/CaffeinaLab/GCM/issues/3#issuecomment-157497756","issue_url":"https://api.github.com/repos/CaffeinaLab/GCM/issues/3","id":157497756,"user":{"login":"adammagana","id":641064,"avatar_url":"https://avatars.githubusercontent.com/u/641064?v=3","gravatar_id":"","url":"https://api.github.com/users/adammagana","html_url":"https://github.com/adammagana","followers_url":"https://api.github.com/users/adammagana/followers","following_url":"https://api.github.com/users/adammagana/following{/other_user}","gists_url":"https://api.github.com/users/adammagana/gists{/gist_id}","starred_url":"https://api.github.com/users/adammagana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adammagana/subscriptions","organizations_url":"https://api.github.com/users/adammagana/orgs","repos_url":"https://api.github.com/users/adammagana/repos","events_url":"https://api.github.com/users/adammagana/events{/privacy}","received_events_url":"https://api.github.com/users/adammagana/received_events","type":"User","site_admin":false},"created_at":"2015-11-17T20:30:38Z","updated_at":"2015-11-17T20:30:38Z","body":"![i-have-no-idea-what-im-doing-dog-01](https://cloud.githubusercontent.com/assets/641064/11223866/1902f698-8d40-11e5-98d9-3f8bbfdeccdf.jpg)\r\nThanks for helping. I'll go back into my hole now."}}