mrth2 / apns-php

Automatically exported from code.google.com/p/apns-php
0 stars 0 forks source link

Invalid token (code 8) occurs after an internal error is encountered #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using apns-php <http://code.google.com/p/apns-php/> to send notifications 
and somewhere in the middle it encounters an internal error(999) while sending 
the message objects. 
Right after the internal error(999), apns-php treats the remaining tokens as 
Invalid tokens(8). The internal error occurs before reaching the last message 
object.

Here is the first Internal error object encountered
<pre>
/*****************

[304]=>
  array(3) {
    ["MESSAGE"]=>
    object(ApnsPHP_Message)#306 (9) {
      ["_notification_delivery_id"]=>
      int(-1)
      ["_bAutoAdjustLongPayload":protected]=>
      bool(true)
      ["_aDeviceTokens":protected]=>
      array(1) {
        [0]=>
        string(64) "XXX_HIDDEN_FOR_SECUIRITY_XXX"
      }
      ["_sText":protected]=>
      NULL
      ["_nBadge":protected]=>
      int(304)
      ["_sSound":protected]=>
      NULL
      ["_aCustomProperties":protected]=>
      NULL
      ["_nExpiryValue":protected]=>
      int(604800)
      ["_mCustomIdentifier":protected]=>
      string(17) "Message-Badge-304"
    }
    ["BINARY_NOTIFICATION"]=>
    string(66) "BINARY_NOTFICATION"aps":{"badge":304}}"
    ["ERRORS"]=>
    array(2) {
      [0]=>
      array(3) {
        ["identifier"]=>
        int(304)
        ["statusCode"]=>
        int(999)
        ["statusMessage"]=>
        string(52) "Internal error (0 bytes written instead of 66 bytes)" 
      }
      [1]=>
      array(5) {
        ["command"]=>
        int(8)
        ["statusCode"]=>
        int(8)
        ["identifier"]=>
        int(304)
        ["time"]=>
        int(1346235506)
        ["statusMessage"]=>
        string(13) "Invalid token"
      }
    }
  }
/**********
</pre>
After this error message, all the remaining tokens are printed as  invalid 
token with code 8.

I'm trying to send at least 400 notifications using the sample_push_many.php 
template, and the number of device token will surely grow once my service is 
published to production mode.

Is it normal so send 400 or greater notification with the sample_push_many.php 
template? Could this be related to memory leak on the server?

Server Info:
Operating system    Linux
Architecture            x86_64
PHP version         5.3.4

Any idea how i can over come this issue?

Original issue reported on code.google.com by beakal.g...@approbatics.com on 29 Aug 2012 at 5:24

GoogleCodeExporter commented 8 years ago
Any thing new on this bug?

Original comment by beakal.g...@approbatics.com on 3 Sep 2012 at 2:28

GoogleCodeExporter commented 8 years ago
Dear,

The project source code has moved to github; if your issue is still valid, 
please open it on github page https://github.com/duccio/ApnsPHP/issues

Thanks.

Original comment by aldo.arm...@gmail.com on 26 Oct 2012 at 11:48