$q2="SELECT pushtoken FROM devices WHERE id='deviceid'";
$r2=$this->db->query($q2);
require_once 'ApnsPHP/Autoload.php';
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX,
'mypassbookcoupon.pem' //as defined in the passbook documentation, use the same certificate that is used to sign the passes
);
$push->setRootCertificationAuthority('entrust.pem'); //as downloaded from entrust.
$push->connect();
while ($row2 = $r2->fetchColumn()) {
$message = new ApnsPHP_Message(''.$row2.'');
$message->setCustomProperty(''); //blank json payload as defined in passbook documentation (is this correct?)
print_r($message);
$push->add($message);
$push->send();
}
$push->disconnect();
$aErrorQueue = $push->getErrors();
if (!empty($aErrorQueue)) {
var_dump($aErrorQueue);
}
This is correct , no doubt , the APN is from your server and Passbook not you App
It was actually my web service (API) implementation that was the error for me. Using Charles Proxy to sniff traffic from Passbook making it clear for me.The push message to APNS should not have any additional body, just the push token (receiver).
--
You received this message because you are subscribed to a topic in the Google Groups "apns-php" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/apns-php/AChGyVwH7Zc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to apns-php+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.