そうしないとエラーのトークンみつかったらそこで処理止まっちゃうよ
$pem_data_1 = (dirname(__FILE__).'/server_certificates_bundle_production.pem'); $pem_data_2 = (dirname(__FILE__).'/entrust_root_certification_authority.pem'); $push = new ApnsPHP_Push(ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $pem_data_1); $push->setRootCertificationAuthority($pem_data_2); $push->connect(); try{ $message = new ApnsPHP_Message(デバイストークン); $message->setText(プッシュメッセージ); $message->setSound(); $message->setCustomProperty('acme2', array('bang', 'whiz')); $push->add($message); $push->send(); $push->getErrors(); }catch (ApnsPHP_Message_Exception $e){ $e->getMessage(); } $push->disconnect();
ネタ元