function pushAPN() { $igt = new IGeTui(HOST, APPKEY, MASTERSECRET); $template = new IGtAPNTemplate(); $template->set_pushInfo("", 1, "dd", "", "", "", "", "", 1); $message = new IGtSingleMessage(); $message->set_data($template); $ret = $igt->pushAPNMessageToSingle(APPID, DEVICETOKEN, $message); var_dump($ret); }
function pushAPN() { //APN简单推送 $igt = new IGeTui(HOST, APPKEY, MASTERSECRET); $template = new IGtAPNTemplate(); $apn = new IGtAPNPayload(); $alertmsg = new SimpleAlertMsg(); $alertmsg->alertMsg = ""; $apn->alertMsg = $alertmsg; // $apn->badge=2; $apn->sound = ""; $apn->add_customMsg("payload", "payload"); $apn->contentAvailable = 1; $apn->category = "ACTIONABLE"; $template->set_apnInfo($apn); $message = new IGtSingleMessage(); //APN高级推送 // $igt = new IGeTui(HOST,APPKEY,MASTERSECRET); // $template = new IGtAPNTemplate(); // $apn = new IGtAPNPayload(); // $alertmsg=new DictionaryAlertMsg(); // $alertmsg->body="body"; // $alertmsg->actionLocKey="ActionLockey"; // $alertmsg->locKey="LocKey"; // $alertmsg->locArgs=array("locargs"); // $alertmsg->launchImage="launchimage"; //// IOS8.2 支持 // $alertmsg->title="Title"; // $alertmsg->titleLocKey="TitleLocKey"; // $alertmsg->titleLocArgs=array("TitleLocArg"); // // $apn->alertMsg=$alertmsg; // $apn->badge=7; // $apn->sound="test1.wav"; // $apn->add_customMsg("payload","payload"); // $apn->contentAvailable=1; // $apn->category="ACTIONABLE"; // $template->set_apnInfo($apn); // $message = new IGtSingleMessage(); //PushApn老方式传参 // $igt = new IGeTui(HOST,APPKEY,MASTERSECRET); // $template = new IGtAPNTemplate(); // $template->set_pushInfo("actionLocKey", 6, "body", "", "payload", "locKey", "locArgs", "launchImage",1); // $message = new IGtSingleMessage(); //// // $message->set_data($template); $ret = $igt->pushAPNMessageToSingle(APPID, DEVICETOKEN, $message); var_dump($ret); }
private function ios() { $template = new IGtTransmissionTemplate(); $template->set_appId(APPID); //应用appid $template->set_appkey(APPKEY); //应用appkey $template->set_transmissionType(2); //透传消息类型 #$template->set_transmissionContent("title=".title.'&nr='.nr."&type=".type."&id=".id);//透传内容 $template->set_transmissionContent("title=" . TITLE . '&content=' . CONTENT . "&type=" . TYPE . "&id=" . ID); //透传内容 #$template->set_pushInfo("actionLocKey","badge","message","sound","payload","locKey","locArgs","launchImage"); $apn = new IGtAPNPayload(); $alertmsg = new SimpleAlertMsg(); $alertmsg->alertMsg = ""; $apn->alertMsg = $alertmsg; $apn->badge = 2; $apn->sound = ""; $apn->add_customMsg("payload", "title=" . TITLE . '&content=' . CONTENT . "&type=" . TYPE . "&id=" . ID); # $apn->contentAvailable=1; $apn->category = "ACTIONABLE"; $template->set_apnInfo($apn); $igt = new IGeTui(HOST, APPKEY, MASTERSECRET); $message = new IGtSingleMessage(); $message->set_data($template); $ret = $igt->pushAPNMessageToSingle(APPID, DEVICETOKEN, $message); var_dump($ret); }
public function touchuaniosAction() { $template = $this->touchuandemo(); $message = new IGtSingleMessage(); $igt = new IGeTui(HOST, APPKEY, MASTERSECRET); $message->set_data($template); $ret = $igt->pushAPNMessageToSingle(APPID, DEVICETOKEN, $message); var_dump($ret); exit; }