Hi,
I'm experiencing some problems with apns adapter to send push notifications. Some notifications never get to the devices, I get some invalid token errors and some no error at all, but none of them are getting to the user.
For example:
./np push --certificate=/path/to/certificate.pem apns [deviceToken] "Notification test"
Generates this message and output:
object(ZendService\Apple\Apns\Message)#70 (10) {
["id":protected]=>
string(40) "0918e534cfda09bdb5dacce2ab5494680b0e1942"
["token":protected]=>
string(64) "8fc76feb6e889e70afe286104820cf39f7584b32363473898ac38773b97e596a"
["expire":protected]=>
NULL
["alert":protected]=>
object(ZendService\Apple\Apns\Message\Alert)#69 (8) {
["body":protected]=>
string(31) "Notification test"
["actionLocKey":protected]=>
NULL
["locKey":protected]=>
NULL
["locArgs":protected]=>
NULL
["launchImage":protected]=>
NULL
["title":protected]=>
NULL
["titleLocKey":protected]=>
NULL
["titleLocArgs":protected]=>
NULL
}
["badge":protected]=>
NULL
["sound":protected]=>
string(13) "bingbong.aiff"
["contentAvailable":protected]=>
NULL
["category":protected]=>
NULL
["urlArgs":protected]=>
NULL
["custom":protected]=>
array(0) {
}
}
object(ZendService\Apple\Apns\Response\Message)#71 (2) {
["id":protected]=>
int(918)
["code":protected]=>
int(8)
}
Curiously says invalid token when the token has just been registered with a clean app installation. The other case is
./np push apns [deviceToken2] "Notification test 2" --certificate=/path/to/certificate2.pem
And the message and response:
object(ZendService\Apple\Apns\Message)#70 (10) {
["id":protected]=>
string(40) "bae22dd83c3c69a4e45dab9f5bda53d45447ffe0"
["token":protected]=>
string(64) "c653c0d678c5c3084329e6d4b867d8bc9bdfd59f7a90ca5b312d392da44fd225"
["expire":protected]=>
NULL
["alert":protected]=>
object(ZendService\Apple\Apns\Message\Alert)#69 (8) {
["body":protected]=>
string(31) "Notification test 2"
["actionLocKey":protected]=>
NULL
["locKey":protected]=>
NULL
["locArgs":protected]=>
NULL
["launchImage":protected]=>
NULL
["title":protected]=>
NULL
["titleLocKey":protected]=>
NULL
["titleLocArgs":protected]=>
NULL
}
["badge":protected]=>
NULL
["sound":protected]=>
string(13) "bingbong.aiff"
["contentAvailable":protected]=>
NULL
["category":protected]=>
NULL
["urlArgs":protected]=>
NULL
["custom":protected]=>
array(0) {
}
}
object(ZendService\Apple\Apns\Response\Message)#71 (2) {
["id":protected]=>
NULL
["code":protected]=>
int(0)
}
And neither of the notifications were delivered to the devices... anyone can help? That's not like the issue #61 because I'm sending these notifications one at a time.