{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/697","repository_url":"https://api.github.com/repos/ParsePlatform/parse-server","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/697/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/697/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/697/events","html_url":"https://github.com/ParsePlatform/parse-server/issues/697","id":136902969,"number":697,"title":"Parse Server Push giving APNS 513","user":{"login":"AlecKriebel","id":6109370,"avatar_url":"https://avatars.githubusercontent.com/u/6109370?v=3","gravatar_id":"","url":"https://api.github.com/users/AlecKriebel","html_url":"https://github.com/AlecKriebel","followers_url":"https://api.github.com/users/AlecKriebel/followers","following_url":"https://api.github.com/users/AlecKriebel/following{/other_user}","gists_url":"https://api.github.com/users/AlecKriebel/gists{/gist_id}","starred_url":"https://api.github.com/users/AlecKriebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlecKriebel/subscriptions","organizations_url":"https://api.github.com/users/AlecKriebel/orgs","repos_url":"https://api.github.com/users/AlecKriebel/repos","events_url":"https://api.github.com/users/AlecKriebel/events{/privacy}","received_events_url":"https://api.github.com/users/AlecKriebel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-27T09:53:29Z","updated_at":"2016-03-10T03:09:52Z","closed_at":null,"body":"Hi all, \r\n\r\nI'm getting an issue when trying to send push notifications over Parse Server using cloud code, specifically, the heroku server is spitting a 513 APNS at me. This was triggered by calling the cloud function on the iOS client-side.\r\n\r\nI've discluded my keys and urls, etc, so they are in ALL_CAPS. \r\n\r\nWhat do I need to do to make Push notification work on my parse server? Is there an issue with my .p12?\r\n\r\n**Here is my cloud function:**\r\n```\r\nParse.Cloud.define('test', function(req, res) {\r\n\tParse.Push.send({\r\n  \t\tchannels: ['global'],\r\n  \t\tdata: {\r\n    \t\talert: 'Test',\r\n    \t\tbadge: 1,\r\n    \t\tsound: 'default'\r\n  \t\t}\r\n\t}, {\r\n  \t\tsuccess: function() {\r\n    \t\tconsole.log('##### PUSH OK');\r\n  \t\t},\r\n  \t\terror: function(error) {\r\n    \t\tconsole.log('##### PUSH ERROR' + error.message);\r\n  \t\t},\r\n  \t\tuseMasterKey: true\r\n\t});\r\n});\r\n```\r\n\r\n\r\n**Here is my Index.js setup:**\r\n```\r\nvar express = require('express');\r\nvar ParseServer = require('parse-server').ParseServer;\r\n\r\nvar databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI;\r\n\r\nif (!databaseUri) {\r\n  console.log('DATABASE_URI not specified, falling back to localhost.');\r\n}\r\n\r\nvar api = new ParseServer({\r\n  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',\r\n  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',\r\n  appId: process.env.APP_ID || 'APP_ID',\r\n  masterKey: process.env.MASTER_KEY || 'MATER_KEY', //Add your master key here. Keep it secret!\r\n  clientKey: 'CLIENT_KEY',\r\n  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',\r\n  push:{\r\n  \tios: {\r\n\t\t\tpdx: '/Users/AlecKriebel/Desktop/ParsePush.p12', // the path and filename to the .p12 file you exported earlier. \r\n\t\t\tbundleId: 'BUNDLE-ID', \r\n\t\t\tproduction: false\r\n\t\t}\r\n  }\r\n});\r\n// Client-keys like the javascript key or the .NET key are not necessary with parse-server\r\n// If you wish you require them, you can set them as options in the initialization above:\r\n// javascriptKey, restAPIKey, dotNetKey, clientKey\r\n\r\nvar app = express();\r\n\r\n// Serve the Parse API on the /parse URL prefix\r\nvar mountPath = process.env.PARSE_MOUNT || '/parse';\r\napp.use(mountPath, api);\r\n\r\n// Parse Server plays nicely with the rest of your web routes\r\napp.get('/', function(req, res) {\r\n  res.status(200).send('I dream of being a web site.');\r\n});\r\n\r\nvar port = process.env.PORT || 1337;\r\napp.listen(port, function() {\r\n    console.log('parse-server-example running on port ' + port + '.');\r\n});\r\n```\r\n\r\n**Here is the server response:**\r\n```\r\n2016-02-27T09:21:13.320224+00:00 heroku[router]: at=error code=H13 desc=\"Connection closed without response\" method=POST path=\"/parse/functions/test\" host=SERVER_URL request_id=e35a7606-e3e5-4303-a546-b6b604466f01 fwd=\"174.77.32.122\" dyno=web.1 connect=1ms service=637ms status=503 bytes=0\r\n2016-02-27T09:21:13.220879+00:00 app[web.1]: ##### PUSH OK\r\n2016-02-27T09:21:13.322808+00:00 app[web.1]:         sound: 'default',\r\n2016-02-27T09:21:13.322811+00:00 app[web.1]:         category: undefined } },\r\n2016-02-27T09:21:13.322799+00:00 app[web.1]: APNS Notification caused error: 513 for device  Device {\r\n2016-02-27T09:21:13.322803+00:00 app[web.1]:   token: <Buffer bf 90 0f e6 c5 85 85 cb 32 b8 d1 73 65 ce e8 61 3a 13 2d 98 be 3f 1d 50 14 68 a6 f9 c6 0d 68 95>,\r\n2016-02-27T09:21:13.322804+00:00 app[web.1]:   connIndex: 0,\r\n2016-02-27T09:21:13.322809+00:00 app[web.1]:         alert: 'Test',\r\n2016-02-27T09:21:13.322810+00:00 app[web.1]:         'url-args': undefined,\r\n2016-02-27T09:21:13.322806+00:00 app[web.1]:   appIdentifier: 'BUNDLE-ID' } { encoding: 'utf8',\r\n2016-02-27T09:21:13.322806+00:00 app[web.1]:   payload: \r\n2016-02-27T09:21:13.322808+00:00 app[web.1]:       { badge: 1,\r\n2016-02-27T09:21:13.322814+00:00 app[web.1]:   compiled: '{\"aps\":{\"badge\":1,\"sound\":\"default\",\"alert\":\"Test\"}}',\r\n2016-02-27T09:21:13.322807+00:00 app[web.1]:    { aps: \r\n2016-02-27T09:21:13.323511+00:00 app[web.1]: APNS can not find vaild connection for {\"type\":\"Buffer\",\"data\":[191,144,15,230,197,133,133,203,50,184,209,115,101,206,232,97,58,19,45,152,190,63,29,80,20,104,166,249,198,13,104,149]}\r\n2016-02-27T09:21:13.322812+00:00 app[web.1]:   expiry: undefined,\r\n2016-02-27T09:21:13.322815+00:00 app[web.1]:   truncateAtWordEnd: false,\r\n2016-02-27T09:21:13.322812+00:00 app[web.1]:   priority: 10,\r\n2016-02-27T09:21:13.353632+00:00 app[web.1]: npm ERR! argv \"/app/.heroku/node/bin/node\" \"/app/.heroku/node/bin/npm\" \"start\"\r\n2016-02-27T09:21:13.354248+00:00 app[web.1]: npm ERR! npm  v3.6.0\r\n2016-02-27T09:21:13.322813+00:00 app[web.1]:   retryLimit: -1,\r\n2016-02-27T09:21:13.353835+00:00 app[web.1]: npm ERR! node v5.6.0\r\n2016-02-27T09:21:13.322813+00:00 app[web.1]:   device: undefined,\r\n2016-02-27T09:21:13.353332+00:00 app[web.1]: npm ERR! Linux 3.13.0-77-generic\r\n2016-02-27T09:21:13.355041+00:00 app[web.1]: npm ERR! Exit status 1\r\n2016-02-27T09:21:13.322817+00:00 app[web.1]:   _sound: 'default' }\r\n2016-02-27T09:21:13.355376+00:00 app[web.1]: npm ERR! Failed at the parse-server-example@1.1.0 start script 'node index.js'.\r\n```"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments/194639969","html_url":"https://github.com/ParsePlatform/parse-server/issues/697#issuecomment-194639969","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/697","id":194639969,"user":{"login":"AlecKriebel","id":6109370,"avatar_url":"https://avatars.githubusercontent.com/u/6109370?v=3","gravatar_id":"","url":"https://api.github.com/users/AlecKriebel","html_url":"https://github.com/AlecKriebel","followers_url":"https://api.github.com/users/AlecKriebel/followers","following_url":"https://api.github.com/users/AlecKriebel/following{/other_user}","gists_url":"https://api.github.com/users/AlecKriebel/gists{/gist_id}","starred_url":"https://api.github.com/users/AlecKriebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlecKriebel/subscriptions","organizations_url":"https://api.github.com/users/AlecKriebel/orgs","repos_url":"https://api.github.com/users/AlecKriebel/repos","events_url":"https://api.github.com/users/AlecKriebel/events{/privacy}","received_events_url":"https://api.github.com/users/AlecKriebel/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T03:09:52Z","updated_at":"2016-03-10T03:09:52Z","body":"@liennh Hmmm... I had seen that somewhere, but later heard support had been added. I dont see it on [here](https://github.com/ParsePlatform/parse-server/wiki/Push), do you have a link? Any 3rd party push recommendations?"}}