Problems with sending push notifications

132 views
Skip to first unread message

imaidl...@gmail.com

unread,
Sep 28, 2016, 12:57:58 PM9/28/16
to NodeChef

Cann't send push notification to iOS devices.
Response: {"result":true}
Request: 
curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
        "where": {
          "accountId": "accountId"
        },
        "push_time": "2015-03-19T12:00:00Z",
        "data": {
          "alert": "test"
        }
      }' \


dev.no...@gmail.com

unread,
Sep 28, 2016, 1:40:46 PM9/28/16
to NodeChef, imaidl...@gmail.com
Typically issues with push configuration is mainly due to misconfigured certs or not configuring your clients correctly to receive Push from Parse Server.

Message has been deleted

imaidl...@gmail.com

unread,
Sep 29, 2016, 12:13:18 PM9/29/16
to NodeChef, imaidl...@gmail.com
Solution perfectly worked on parse.com. We are migrated to nodechef and uploaded the same certificates to the nodechef's server, but device doesn't receive any type of notifications. What we need to do?

dev.no...@gmail.com

unread,
Sep 29, 2016, 12:20:07 PM9/29/16
to NodeChef, imaidl...@gmail.com
Make sure you have configured your clients to receive push using the below document:

Also you enable APN debugging, you can do this by navigating to App actions > environment variable. Under variable name enter DEBUG and under variable value input apn.
This will print a few debugging information.


Message has been deleted

imaidl...@gmail.com

unread,
Sep 29, 2016, 1:02:49 PM9/29/16
to NodeChef, imaidl...@gmail.com

>Also you enable APN debugging, you can do this by navigating to App actions > environment variable. Under variable name enter DEBUG and under variable value >input apn.
>This will print a few debugging information.

Debug enabled.Where I can find debug information?

When trying
curl -X GET \
>   -H "X-Parse-Application-Id: ${}" \
>   -H "X-Parse-Master-Key: ${}" \

Receive: curl: (7) Failed to connect to appname.nodechef.com port 1337: Connection refused

Doesn't support?

dev.no...@gmail.com

unread,
Sep 29, 2016, 1:06:45 PM9/29/16
to NodeChef, imaidl...@gmail.com
Am curious why are you attempting to connect to port 1337? You should remove :1337 from the url

You can view any logs from App actions > App logs
Message has been deleted

imaidl...@gmail.com

unread,
Sep 29, 2016, 1:34:17 PM9/29/16
to NodeChef, imaidl...@gmail.com

>Am curious why are you attempting to connect to port 1337? You should remove :1337 from the url


Port number taken from https://github.com/ParsePlatform/Parse-Server/wiki/Push-Configuring-Clients 

Response without port 1337: curl: (52) Empty reply from server


Results from App logs (sending with rest-api and from dashboard).

In logs presented: <device: undefined>, but in dashboard: found 1 device


App_name at runSingle (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:137:13) 
at /bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:604:44 
at Promise.promise.promiseDispatch (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:796:13) 
at self.promiseDispatch.done (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:863:30) 
at _fulfilled (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:834:54)
at Connection.<anonymous> (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/connection.js:199:17) 
at apnSocket (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/socket.js:56:19) 
at Object.exports.connect (_tls_wrap.js:971:21) 
at Object.createSecureContext (_tls_common.js:132:17) 
at Error (native) 
Error: Unable to load BIO 

throw err; 
/bundle/node_modules/parse-server/lib/ParseServer.js:405 
Thu, 29 Sep 2016 17:20:36 GMT apn 1 left to send 
Thu, 29 Sep 2016 17:20:36 GMT apn Loading Credentials 
Thu, 29 Sep 2016 17:20:36 GMT apn Initialising connection 
callback: [Function] } 
appIdentifier: '<deleted>', 
connIndex: 0, 
token: <deleted>, 
_alert: 'test' } Device { 
truncateAtWordEnd: false, 
compiled: '{"aps":{"alert":"test"}}', 
device: undefined, 
retryLimit: -1, 
priority: 10, 
expiry: NaN, 
category: undefined } }, 
'url-args': undefined, 
alert: 'test', 
sound: undefined, 
{ badge: undefined, 
{ aps: 
payload: 
Thu, 29 Sep 2016 17:20:36 GMT apn Raising error: 513 { encoding: 'utf8', 
Thu, 29 Sep 2016 17:20:36 GMT apn Module initialisation error: [Error: Unable to load BIO] 
at flush (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:125:13) 
at runSingle (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:137:13) 
at /bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:604:44 
at Promise.promise.promiseDispatch (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:796:13) 
at self.promiseDispatch.done (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:863:30) 
at _fulfilled (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/q/q.js:834:54)
at /bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/connection.js:156:15 
at parse (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/credentials/parse.js:11:21) 
at apnCredentialsFromPkcs12 (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/lib/credentials/parsePkcs12.js:27:24) 
at Object.asn1.fromDer (/bundle/node_modules/parse-server/node_modules/parse-server-push-adapter/node_modules/apn/node_modules/node-forge/js/asn1.js:271:17) 
Thu, 29 Sep 2016 17:20:36 GMT apn Error: Too few bytes to parse DER. 
Thu, 29 Sep 2016 17:20:36 GMT apn 1 left to send 
Thu, 29 Sep 2016 17:20:36 GMT apn Loading Credentials 
Thu, 29 Sep 2016 17:20:36 GMT apn Initialising connection


What should I change?

dev.no...@gmail.com

unread,
Sep 29, 2016, 2:06:15 PM9/29/16
to NodeChef, imaidl...@gmail.com
Can you provide your parse server endpoint. I can check it out.

imaidl...@gmail.com

unread,
Sep 30, 2016, 8:55:52 AM9/30/16
to NodeChef, imaidl...@gmail.com
I think problem is related to certificate parser, because where is no field for providing password for certificate 

imaidl...@gmail.com

unread,
Sep 30, 2016, 12:48:15 PM9/30/16
to NodeChef, imaidl...@gmail.com
Now I get error
ERR! parse-server-push-adapter APNS cannot find vaild connection for 

but with the same certificate I was able to send push notifications using https://github.com/noodlewerk/NWPusher

What I need to do?

david.ans...@gmail.com

unread,
Sep 27, 2018, 6:43:31 AM9/27/18
to NodeChef
Up?

in...@nodechef.com

unread,
Sep 27, 2018, 7:46:58 AM9/27/18
to NodeChef
The APNS cannot find valid connection for error happens when the AppIdentifier does not match the bundleId of the uploaded certificate. To get around this, you can simply update the AppIdentifier field for each installation to match your new certificate bundleId.
Reply all
Reply to author
Forward
0 new messages