Exemple #1
0
/**
 * 创建链接通知
 * @param $t  推送通知标题
 * @param $c  推送通知内容
 * @param $l  推送通知链接地址
 * @return IGtLinkTemplate
 */
function createLinkMessage($t, $c, $l)
{
    $template = new IGtLinkTemplate();
    $template->set_appId(APPID);
    //应用appid
    $template->set_appkey(APPKEY);
    //应用appkey
    $template->set_title($t);
    //通知栏标题
    $template->set_text($c);
    //通知栏内容
    //    $template->set_logo("http://wwww.igetui.com/logo.png");//通知栏logo,不设置使用默认程序图标
    $template->set_isRing(true);
    //是否响铃
    $template->set_isVibrate(true);
    //是否震动
    $template->set_isClearable(true);
    //通知栏是否可清除
    $template->set_url($l);
    //打开连接地址
    //$template->set_duration(BEGINTIME,ENDTIME); //设置ANDROID客户端在此时间区间内展示消息
    return $template;
}
Exemple #2
0
function IGtLinkTemplateDemo()
{
    $template = new IGtLinkTemplate();
    $template->set_appId(APPID);
    //应用appid
    $template->set_appkey(APPKEY);
    //应用appkey
    $template->set_title("请输入通知标题");
    //通知栏标题
    $template->set_text("请输入通知内容");
    //通知栏内容
    $template->set_logo("");
    //通知栏logo
    $template->set_isRing(true);
    //是否响铃
    $template->set_isVibrate(true);
    //是否震动
    $template->set_isClearable(true);
    //通知栏是否可清除
    $template->set_url("http://www.igetui.com/");
    //打开连接地址
    //$template->set_duration(BEGINTIME,ENDTIME); //设置ANDROID客户端在此时间区间内展示消息
    //iOS推送需要设置的pushInfo字段
    //        $apn = new IGtAPNPayload();
    //        $apn->alertMsg = "alertMsg";
    //        $apn->badge = 11;
    //        $apn->actionLocKey = "启动";
    //    //        $apn->category = "ACTIONABLE";
    //    //        $apn->contentAvailable = 1;
    //        $apn->locKey = "通知栏内容";
    //        $apn->title = "通知栏标题";
    //        $apn->titleLocArgs = array("titleLocArgs");
    //        $apn->titleLocKey = "通知栏标题";
    //        $apn->body = "body";
    //        $apn->customMsg = array("payload"=>"payload");
    //        $apn->launchImage = "launchImage";
    //        $apn->locArgs = array("locArgs");
    //
    //        $apn->sound=("test1.wav");;
    //        $template->set_apnInfo($apn);
    return $template;
}
Exemple #3
0
function IGtLinkTemplateDemo()
{
    $template = new IGtLinkTemplate();
    $template->set_appId(APPID);
    //应用appid
    $template->set_appkey(APPKEY);
    //应用appkey
    $template->set_title("请输入通知标题");
    //通知栏标题
    $template->set_text("请输入通知内容");
    //通知栏内容
    $template->set_logo("");
    //通知栏logo
    $template->set_isRing(true);
    //是否响铃
    $template->set_isVibrate(true);
    //是否震动
    $template->set_isClearable(true);
    //通知栏是否可清除
    $template->set_url("http://www.igetui.com/");
    //打开连接地址
    // iOS推送需要设置的pushInfo字段
    //$template ->set_pushInfo($actionLocKey,$badge,$message,$sound,$payload,$locKey,$locArgs,$launchImage);
    //$template ->set_pushInfo("",2,"","","","","","");
    return $template;
}
Exemple #4
0
 public static function IGtLinkTemplateDemo($title, $content, $url)
 {
     $template = new \IGtLinkTemplate();
     $template->set_appId(config('getui-push.android.id'));
     //应用appid
     $template->set_appkey(config('getui-push.android.key'));
     //应用appkey
     $template->set_title($title);
     //通知栏标题
     $template->set_logo("ic_launcher.png");
     //通知栏图标
     $template->set_text($content);
     //通知栏内容
     $template->set_isRing(true);
     //是否响铃
     $template->set_isVibrate(true);
     //是否震动
     $template->set_isClearable(true);
     //通知栏是否可清除
     $template->set_url($url);
     //打开连接地址
     return $template;
 }