Commit f0416208 authored by hujun's avatar hujun

推送模板修改

parent d274ccc7
...@@ -92,7 +92,7 @@ class GeTuiUtils ...@@ -92,7 +92,7 @@ class GeTuiUtils
$target->set_clientId($v); $target->set_clientId($v);
// dump($target); // dump($target);
$res = $igt->pushMessageToSingle($message, $target); $res = $igt->pushMessageToSingle($message, $target);
dump($res);
if ($res['result'] == 'ok') { if ($res['result'] == 'ok') {
$result['code'] = 'success'; $result['code'] = 'success';
$result['msg'] = $res['result']; $result['msg'] = $res['result'];
...@@ -102,7 +102,7 @@ class GeTuiUtils ...@@ -102,7 +102,7 @@ class GeTuiUtils
break; break;
} }
} }
die;
return $result; return $result;
} }
...@@ -117,27 +117,18 @@ class GeTuiUtils ...@@ -117,27 +117,18 @@ class GeTuiUtils
*/ */
function onlineAllTemplate($payload, $black_title, $content) function onlineAllTemplate($payload, $black_title, $content)
{ {
$template = new \IGtNotificationTemplate();
$template = new \IGtTransmissionTemplate();
$template->set_appId($this->igt_app_id);//应用appid $template->set_appId($this->igt_app_id);//应用appid
$template->set_appkey($this->igt_app_key);//应用appkey $template->set_appkey($this->igt_app_key);//应用appkey
$template->set_transmissionType(2);//透传消息类型 $template->set_transmissionType(1);//透传消息类型
$template->set_transmissionContent($payload); //透传内容 $template->set_transmissionContent($payload);//透传内容
$template->set_title($black_title);//通知栏标题
//APN高级推送 $template->set_text($content);//通知栏内容
$apn = new \IGtAPNPayload(); // $template->set_logo("http://wwww.igetui.com/logo.png");//通知栏logo
$alert_msg = new \DictionaryAlertMsg(); $template->set_isRing(true);//是否响铃
$alert_msg->body = $content;//对应的是在线透传的content $template->set_isVibrate(true);//是否震动
$alert_msg->actionLocKey = "打开同联商业";//滑动打开app $template->set_isClearable(true);//通知栏是否可清除
$alert_msg->locKey = $content;//锁屏提示下框 //$template->set_duration(BEGINTIME,ENDTIME); //设置ANDROID客户端在此时间区间内展示消息
$alert_msg->title = $black_title;//标题 锁屏标题
$alert_msg->titleLocKey = $black_title;//下拉通知上部框框
$alert_msg->titleLocArgs = [ "TitleLocArg" ];
$apn->alertMsg = $alert_msg;
$apn->badge = 1;//应用icon上显示的数字
$apn->sound = "";
$template->set_apnInfo($apn);
return $template; return $template;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment