php - ApnsPHP - Getting error while sending Push Notification -


i integrated push notification library sending out push notifications. when tested on local machine worked fine when uploaded library sample code live server throws me error, pasted response below...what found real error in whole response --> 'error: unable send message id 1: missing payload (4)'. need resolve issue.

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 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 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 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 unrecoverable error (4), removing queue without retrying...  thu, 18 apr 2013 12:58:31 +0200 apnsphp[17833]: info: disconnected.  

.

array(1) { [1]=> array(3)  {     ["message"]=> object(apnsphp_message)#3 (9)     {      ["_bautoadjustlongpayload:protected"]=> bool(true) ["_adevicetokens:protected"]=> array(1)     {        [0]=> string(64) "fb7b2a31f06532ead2973c1512a27a4f48fe22d9afb9ee9f33b566b73a768935"      }     ["_stext:protected"]=> string(26) "hello apns-enabled device!" ["_nbadge:protected"]=> int(3) ["_ssound:protected"]=> string(7) "default" ["_bcontentavailable:protected"]=> null ["_acustomproperties:protected"]=> array(2)    {      ["acme2"]=> array(2) { [0]=> string(4) "bang" [1]=> string(4) "whiz" }      ["acme3"]=> array(2) { [0]=> string(4) "bing" [1]=> string(4) "bong" }    }   ["_nexpiryvalue:protected"]=> int(30) ["_mcustomidentifier:protected"]=> string(16) "message-badge-33"     }    ["binary_notification"]=> string(45) "qoÑô û{*1ðe2êÒ—<¢zohþ"Ù¯¹îŸ3µf·:v‰5" ["errors"]=> array(1) { [0]=> array(5) { ["command"]=> int(8) ["statuscode"]=> int(4) ["identifier"]=> int(1) ["time"]=> int(1366282710) ["statusmessage"]=> string(15) "missing payload"     }   }  } }  

thanks in advance

ps: in google groups posted same issue solution not available.

after day of tests, i've located problem: json_encode function takes 2nd parameter "options" 5.3 php version: http://php.net/manual/en/function.json-encode.php

locally have php v5.3.x, code worked fine 2nd parameter in json_encode function. on live server php version 5.2.6, 2nd parameter in code json_encode causing issue , throwing "missing payload" error. removed 2nd parameter , works fine me :)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -