!--? php require_once ' vendor/autoload.php '; use Jpush\model as M;use Jpush\jpushclient;use Jpush\exception\apiconnectionexception;use jpush\exception\apirequestexception;//Date_ Default_timezone_set (PRC); Date_default_timezone_set ("Asia/shanghai"), $app _key= ' 10310527ba9fce07c22bc849 '; $master _secret= ' Fa3bf270631e1a688281efbe ';//echo "
start
"; $br = '
'; $client = new Jpushclient ($app _key, $master _secret) ; $tname = "testteacheraqq_com"; $day = "2016-1-12 11:01:02"; $oid = "123424"; $result = $client->push ()->setplatform (M\all)->setaudience (M\audience (M\alias (Array ($tname)))->setnotification (M\notification ("Linghaowa N.the appointment at ". $day." Had finished. # ". $oid))->send ();//Echo ' Push Success. ' $BR;//Echo ' Sendno: '. $result->sendno. $BR;//Echo ' msg_id: '. $result->msg_id. $BR;//Echo ' Response JSON: '. $result->json. $BR;
Back-end only once, but the phone will receive up to 4, the browser will also error
Fatal error: Uncaught exception 'JPush\Exception\APIConnectionException' with message 'Response timeout. Your request has probably be received by JPUsh Server,please check that whether need to be pushed again
Reply content:
!--? php require_once ' vendor/autoload.php '; use Jpush\model as M;use Jpush\jpushclient;use Jpush\exception\apiconnectionexception;use jpush\exception\apirequestexception;//Date_ Default_timezone_set (PRC); Date_default_timezone_set ("Asia/shanghai"), $app _key= ' 10310527ba9fce07c22bc849 '; $master _secret= ' Fa3bf270631e1a688281efbe ';//echo "
start
"; $br = '
'; $client = new Jpushclient ($app _key, $master _secret) ; $tname = "testteacheraqq_com"; $day = "2016-1-12 11:01:02"; $oid = "123424"; $result = $client->push ()->setplatform (M\all)->setaudience (M\audience (M\alias (Array ($tname)))->setnotification (M\notification ("Linghaowa N.the appointment at ". $day." Had finished. # ". $oid))->send ();//Echo ' Push Success. ' $BR;//Echo ' Sendno: '. $result->sendno. $BR;//Echo ' msg_id: '. $result->msg_id. $BR;//Echo ' Response JSON: '. $result->json. $BR;
Back-end only once, but the phone will receive up to 4, the browser will also error
Fatal error: Uncaught exception 'JPush\Exception\APIConnectionException' with message 'Response timeout. Your request has probably be received by JPUsh Server,please check that whether need to be pushed again
Is the network latency problem, you can set the Connect_timeout in the SDK longer (10 seconds) just fine.
It is also recommended to upgrade to the latest SDK, the new version of the interface than the old easy to use a lot!