/**
  * Send notification to devices tokens
  *
  * @throws InvalidArgumentException
  * @param Payload $payload
  * @param array $tokens
  */
 public function send(Payload $payload, $tokens)
 {
     if (!count($tokens) > 0) {
         return true;
     }
     //Open connection
     $this->connect();
     // Encode payload as JSON
     $json_payload = json_encode($payload->getApsFormat());
     // Build the binary notification to each token
     $data = '';
     foreach ($tokens as $tk) {
         $data .= chr(0) . pack('n', 32) . pack('H*', str_replace(' ', '', $tk)) . pack('n', strlen($json_payload)) . $json_payload;
     }
     // Send data to the server
     return $this->write($data);
 }