Closed butterfly-thomasdittmar closed 6 years ago
UPDATE
Since there is no error output I had to find a way to print/return the error.
I went to the following file node_modules/node-pushnotifications/lib/sendAPN.js
and modified the code so I get error msg's
(response.failed || []).forEach(function (failure) {
resumed.failure += 1;
resumed.message.push(response.failed)
// if (failure.error) {
// // A transport-level error occurred (e.g. network problem)
// resumed.message.push({
// regId: failure.device,
// error: failure.error
// });
// } else {
// // `failure.status` is the HTTP status code
// // `failure.response` is the JSON payload
// resumed.message.push({
// regId: failure.device,
// error: new Error(failure.response.reason || failure.response)
// });
// }
});
That produced the following return msg
[{"method":"apn","success":0,"failure":1,"message":[[{"device":"e90356be05f7296006a5d30232b30a5b4dcf580b83254ee0e27cab0328f228cd","status":"400","response":{"reason":"MissingTopic"}}]]}]
After adding topic: '<bundle identifier>'
to the data I can finally send PN to production. That means that TOPIC is needed in production!!!!
@butterfly-thomasdittmar yes topic
is required, as can be seen in the documentation here https://github.com/appfeel/node-pushnotifications#apn
Hope everything works fine now?
Hi @alex-friedl,
Yes, everything works fine now.
As a suggestion, can you add topic: '', // REQUIRED for apn and gcm for ios
into this section of the HOW-TO
Good point. Made the change in https://github.com/appfeel/node-pushnotifications/pull/68
Hi,
I love the lib, which worked great until I tried testing in production.
Here are the steps I have done to get
dev
&prod
certificates..cer
for development =>apn_development.cer
.cer
for production =>apn_production.cer
.p12
for push notificationpush_cert.p12
.cer
to.pem
=>apn_development.pem
&apn_production.pem
.p12
to.pem
=>push_cert.pem
Which works fine.
.p12
file for production. Here the log:7.5. Change NODE project and test
Now I get an error
[{"method":"apn","success":0,"failure":1,"message":[{"regId":"e90356be05f7296006a5d30232b30a5b4dcf580b83254ee0e27cab0328f228cd","error":{}}]}]
7.6. Try to connect with OpenSSLThat seemed to work. I can clearly see the certs work.
I wonder what else could be wrong?
Cheers, Tom