immobiliare / ApnsPHP

ApnsPHP: Apple Push Notification & Feedback Provider
BSD 3-Clause "New" or "Revised" License
1.44k stars 453 forks source link

Push is received but page is loading continuesaly on AWS Server #91

Open mitulshah4 opened 9 years ago

mitulshah4 commented 9 years ago

Hi, I'm using PHP Version 5.6.8 with latest version of ApnsPHP. I'm pasting my code below which is loading continuously but I am getting Push in devices.

Filename : testpush.php ( page contains only below code)

include 'application/libraries/ApnsPHP/Autoload.php';

// Instantiate a new ApnsPHP_Push object
$apns_message = new ApnsPHP_Message();
$apns_message->setCustomIdentifier("Message-Badge-3");
$apns_message->setText('Test Message');
$apns_message->setSound('Sounds.caf');
$apns_message->setBadge(0);

$receivers = array('cb9e63***0162116255ef9***324354****c7da4ac72ba5bbc91b17076c06f6f','d67a5d2e22c05***571ce64e6c59d81a1***30a0cbc5ba440***986d143702e9');

for ( $i = 0; $i < count($receivers); $i ++ ) {
    $apns_message->addRecipient($receivers[$i]);
}

if ( $apns_message->getRecipientsNumber() > 0 ) {
    $push = new ApnsPHP_Push(
            0, 
            'upload/pushcert.pem'
    ); 
    $push->connect();

    $push->add($apns_message);

    $push->send();
    $push->disconnect();
}

Facing the issue only on AWS Elastic Beanstalk and working fine on local. Can anybody suggest the answer ?

rwforsythe commented 9 years ago

Looks like this issue: https://github.com/immobiliare/ApnsPHP/issues/84

If so, the bug in PHP will be fixed in 5.6.9.

rwforsythe commented 9 years ago

Seems like PHP 5.6.9 and 5.5.25 fix this issue.