Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending push notifications in production environment not working #25

Open
bobcaprice opened this issue Nov 13, 2014 · 2 comments
Open

Comments

@bobcaprice
Copy link

Hi,

I'm facing a strange problem where push notifications are working perfectly in the sandbox environment but not in production. We have verified that the .p12 certificate is working and can use the same certificate to send push notifications from another server application.

I'm using the node plugin for eclipse and stepping through the code and it appears that the notifications aren't being sent at all. The reason for this seems to be because the queue, to which the push tasks have been assigned, is paused - ie has its _paused field set to true.

However, no error is being thrown and as a result my node server thinks the push notifications have been sent, yet the devices never receive them.

It also appears that the exports.gatewayOptions function is being called repeatedly (I checked this to make sure it was picking up the correct host, in terms of sandbox and production) as a result of listOnTimeout() in timers.js, Agent._reconnect() in live.js, and Agent.connect() in live.js. For what it's worth, it is picking up the correct production URL, but the fact that this method is called repeatedly - every five seconds or so - made me wonder if there were somehow connection problems.

Can you help?

Thanks very much in advance.

Bob

@marcbenito
Copy link

You are totally true apnagent its not working.. i have the same problem..
I spend a lot of hours thinking that i was wrong with my production certificates or something like that but the problem was in apagent :(
I finally decided to migrate my code to https://github.com/argon/node-apn with same keys and same config putting the NODE_ENV=production. If you follow the instructions you'll achieve push in production environ

@fmarcheski
Copy link

Hey guys & girls. I was having the same problem until I uncovered a simple thing. APNS Production and Staging device tokens are not identical. So, if you have a non-production build on your device (local testing) your device will have a 'Dev' device token. And if you send that device token with Production credentials, it will not be delivered. Simple. That was my issue which was my simple ignorance of APNS. Perhaps this helps others.

See this SO link: http://stackoverflow.com/questions/15595720/apple-push-notification-not-working-in-production

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants