title: ApnsPHP - Getting error while sending Push Notification
body: <p>I integrated Push Notification library for sending out Push Notifications. When i tested it on my local machine it worked fine but when i uploaded library sample code to live server it throws me error, I pasted the response below...What i found the real error in this whole response is --> 'ERROR: Unable to send message ID 1: Missing payload (4)'.  I need help to resolve this issue.</p>
  
  <pre><code>Thu, 18 Apr 2013 12:58:29 +0200 ApnsPHP[17833]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195.
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Sending messages queue, run #1: 1 message(s) left in queue. 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: STATUS: Sending message ID 1 [custom identifier: Message-Badge-33] (1/3): 45 bytes. 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: ERROR: Unable to send message ID 1: Missing payload (4). 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Disconnected. Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Trying ssl://gateway.sandbox.push.apple.com:2195... 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Connected to ssl://gateway.sandbox.push.apple.com:2195. 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: INFO: Sending messages queue, run #2: 1 message(s) left in queue. 
  Thu, 18 Apr 2013 12:58:30 +0200 ApnsPHP[17833]: WARNING: Message ID 1 [custom identifier: Message-Badge-33] has an unrecoverable error (4), removing from queue without retrying... 
  Thu, 18 Apr 2013 12:58:31 +0200 ApnsPHP[17833]: INFO: Disconnected. 
  </code></pre>
  
  <p>.</p>
  
  <pre><code>array(1) { [1]=&gt; array(3) 
  { 
     ["MESSAGE"]=&gt; object(ApnsPHP_Message)#3 (9) 
     { 
      ["_bAutoAdjustLongPayload:protected"]=&gt; bool(true) ["_aDeviceTokens:protected"]=&gt; array(1)
      { 
        [0]=&gt; string(64) "FB7B2A31F06532EAD2973C1512A27A4F48FE22D9AFB9EE9F33B566B73A768935" 
      } 
     ["_sText:protected"]=&gt; string(26) "Hello APNs-enabled device!" ["_nBadge:protected"]=&gt; int(3) ["_sSound:protected"]=&gt; string(7) "default" ["_bContentAvailable:protected"]=&gt; NULL ["_aCustomProperties:protected"]=&gt; array(2) 
    { 
      ["acme2"]=&gt; array(2) { [0]=&gt; string(4) "bang" [1]=&gt; string(4) "whiz" } 
      ["acme3"]=&gt; array(2) { [0]=&gt; string(4) "bing" [1]=&gt; string(4) "bong" } 
    }
    ["_nExpiryValue:protected"]=&gt; int(30) ["_mCustomIdentifier:protected"]=&gt; string(16) "Message-Badge-33" 
     } 
    ["BINARY_NOTIFICATION"]=&gt; string(45) "QoÑô û{*1ðe2êÒ—&lt;¢zOHþ"Ù¯¹îŸ3µf·:v‰5" ["ERRORS"]=&gt; array(1) { [0]=&gt; array(5) { ["command"]=&gt; int(8) ["statusCode"]=&gt; int(4) ["identifier"]=&gt; int(1) ["time"]=&gt; int(1366282710) ["statusMessage"]=&gt; string(15) "Missing payload" 
     }
    }
   }
  } 
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>PS: Someone in google groups also posted the same issue but the solution is not available.</p>