dirs->root.'ssl/'; // @todo: change this after aproved if (1==2 && $env == 'live') { $push = new ApnsPHP_Push( ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $certs.'aps_production_com.crunchbutton.cockpit.pem' ); } else { $push = new ApnsPHP_Push( ApnsPHP_Abstract::ENVIRONMENT_SANDBOX, $certs.'aps_development_com.crunchbutton.cockpit.pem' ); } $push->setRootCertificationAuthority($certs.'entrust_root_certification_authority.pem'); $push->connect(); foreach ($to as $t) { if (!$t) { continue; } $msg = new ApnsPHP_Message($t); $msg->setCustomIdentifier($id); $msg->setText($message); $msg->setSound($sound); $msg->setExpiry(30); $msg->setBadge($count); if ($category) { $msg->setCategory($category); } $push->add($msg); } $push->send(); $push->disconnect(); $aErrorQueue = $push->getErrors(); return $aErrorQueue ? $aErrorQueue : true; } }