change APNs url to var url = 'gateway.push.apple.com'; from gateway.sandbox.push.apple.com