php - How can I send push notification to multiple devices in one go in iPhone? -
i want send same messages devices registered application how can send them without making multiple connections...
my current php code:
ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'ck.pem'); $fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, stream_client_connect, $ctx); if (!$fp) { print "failed connect $err $errstr\n"; return; } $msg = chr(0) . pack("n",32) . pack('h*', str_replace(' ', '', $devicetoken)) . pack("n",strlen($payload)) . $payload; fwrite($fp, $msg);
bottom line, can't. need send message each token.
its not working email can have multiple recipients.
once connection open can send bunch of messages, thats preferred way (based on apples sdk).
from sdk:
you should retain connections apns across multiple notifications. apns may consider connections rapidly , repeatedly established , torn down denial-of-service attack. upon error, apns closes connection on error occurred.
Comments
Post a Comment