title: Sending APNS push with Azure and Node.js to iOS not working
body: <p>I need to send push notifications to iOS devices with Azure. I added the <code>Notification Hub</code> and the <code>p12</code> certificate to it. </p>
  
  <p>This is my <code>node.js</code> code: </p>
  
  <pre><code>async function sendPush(token) {
     var notificationHubService = azure.createNotificationHubService('hub name','connection string');
  
     // registration is done only once: 
     notificationHubService.apns.createNativeRegistration(token, ['tag_associated_with_token'], null, callback);
  
     var payload = {
         alert: 'Hello!'
     };
  
     // send notification to all registered devices: 
     notificationHubService.apns.send(null, payload, null, function(error, response){
       if(!error){
          console.log('notification sent:');
          console.log(response);
       }
       else {
          console.log('error ');
          console.log(error);
       }
    });
  }
  </code></pre>
  
  <p>Everything seems to work. I get a successful registration, and when listing my registrations I can see that it's there. Sending the notification has a <code>success</code> response: </p>
  
  <pre><code>{ isSuccessful: true,
     statusCode: 201,
     body: '',
     headers:
      { 'transfer-encoding': 'chunked',
        'content-type': 'application/xml; charset=utf-8',
        server: 'Microsoft-HTTPAPI/2.0',
        date: 'Wed, 17 Jul 2019 12:43:40 GMT',
        connection: 'close' },
      md5: undefined 
  }  
  </code></pre>
  
  <p>And that's it. Looks like all is well. But the device does not get a notification. </p>
  
  <p>The device token is correct. The app allows notifications. When setting the certificate in the Azure portal I tried both <code>production</code> or 'sandbox'. As far as I can see everything should work. I also tried the Test feature on the portal itself and it reports <code>success</code> but the device doesn't get anything. </p>
  
  <p>What am I missing? </p>