php - APN Working with One Device but Not with Multiple Devices -
i trying send push notification bunch of ipads , tested first device have. worked fine. tried expand include multiple devices, including own, , doesn't seem work (checked other relevant device holders make sure). device token information appears fine. wrong? maybe it's throttling issue?
i tried rewrite following tutorial , issue still same: http://learn-php-by-example.blogspot.co.il/2013/01/working-with-apple-push-notification.html
i no error in checkappleerrorresponse
function.
here code changes when changed 1 device many:
foreach ($device_tokens $token) { $apple_identifier = '[censored]'; $payload = json_encode($body); $msg = pack("c", 1) . pack("n", $apple_identifier) . pack("n", $apple_expiry) . pack("n", 32) . pack('h*', str_replace(' ', '', $token)) . pack("n", strlen($payload)) . $payload; /* sends notification */ fwrite($fp, $msg); $this->checkappleerrorresponse($fp); }
update: tried manually copy of tokens , random tests on when devices receive notifications. although can't results conclusive, turns out when tokens valid (devices exist in our company), messages go through. however, when add @ least 1 device can't check (means might invalid, or user refused notifications), none of devices in list messages.
the question is, mean apple requires entire array of tokens valid devices owners authorized apns? (seems illogical, it's explanation can think of).
Comments
Post a Comment