title: Unable to receive push notifications with Ionic and Cordova
body: <p>I'm trying to receive push notifications with Ionic and Cordova, but I'm unable to locate where the error occurs, because everything seems to be running smoothly.</p>
  
  <p>First of all, I'm starting a new and clean Ionic project for debugging's sake. These are my exact commands:</p>
  
  <pre><code>ionic start myApp tabs
  cd myApp
  ionic platform add ios
  cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
  </code></pre>
  
  <p>Then I'm adding this to the <code>$ionicPlatform.ready(function(){...})</code> block:</p>
  
  <pre><code>var push = PushNotification.init({
      ios: {
          alert: "true",
          badge: "true",
          sound: "true"
      }
    });
  
  push.on('registration', function(data) {
    console.log(data);
  });
  
  push.on('notification', function(data) {
    console.log(data);
  });
  
  push.on('error', function(e) {
    console.log(e);
  });
  </code></pre>
  
  <p>Which logs this to the Xcode console:</p>
  
  <pre><code>Push Plugin register success: &lt;xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx&gt;
  2016-03-26 00:51:49.286 HelloCordova[913:278481] {"registrationId":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
  </code></pre>
  
  <p>But when I'm trying to use apn in Node.js to send notifications, they are never received, even though no errors occur in Node. I'm not able to receive the notifications by using the APN Tester from the Mac app store either, even though everything seems to be running fine there too.</p>
  
  <p>When I'm testing my key.pem and cert.pem files as suggested by the phonegap-plugin-push documentation, I get this:</p>
  
  <pre><code>openssl s_client -connect gateway.push.apple.com:2195 -cert cert.pem -key key.pem
  CONNECTED(00000003)
  depth=1 /C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
  verify error:num=20:unable to get local issuer certificate
  verify return:0
  ---
  Certificate chain
   0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN=gateway.push.apple.com
     i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
   1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
     i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048)
  ---
  Server certificate
  -----BEGIN CERTIFICATE-----
  **VERY LONG CERTIFICATE**
  -----END CERTIFICATE-----
  subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN=gateway.push.apple.com
  issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C
  ---
  Acceptable client certificate CA names
  /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Root CA
  /C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority
  /C=US/O=Apple Inc./OU=Apple Certification Authority/CN=Apple Application Integration Certification Authority
  ---
  SSL handshake has read 3144 bytes and written 2148 bytes
  ---
  New, TLSv1/SSLv3, Cipher is AES256-SHA
  Server public key is 2048 bit
  Secure Renegotiation IS supported
  Compression: NONE
  Expansion: NONE
  SSL-Session:
      Protocol  : TLSv1
      Cipher    : AES256-SHA
      Session-ID: 
      Session-ID-ctx: 
      Master-Key: **MY-MASTER-KEY**
      Key-Arg   : None
      Start Time: 1458949317
      Timeout   : 300 (sec)
      Verify return code: 0 (ok)
  ---
  closed
  </code></pre>
  
  <p>Any suggestions to why this is not giving the expected results would be appreciated.</p>