|
@@ -59,21 +59,22 @@ class Message extends Api
|
|
|
}
|
|
|
|
|
|
|
|
|
- function createNotification($enContent,$segment){
|
|
|
+ function createNotification($one_push){
|
|
|
+ $template_dsc =$one_push['template_dsc'];
|
|
|
+ $segment =$one_push['group_name'];
|
|
|
+ $title =$one_push['template_name'];
|
|
|
+ $type =$one_push['type'];
|
|
|
+ $url =$one_push['para'];
|
|
|
$content = new StringMap();
|
|
|
- $content->setEn($enContent);
|
|
|
+ $content->setEn($template_dsc);
|
|
|
$notification = new Notification();
|
|
|
$notification->setAppId('6bbd561f-4d8e-4d04-a6c4-dbef1bf99694');
|
|
|
$notification->setContents($content);
|
|
|
$notification->setIncludedSegments([$segment]);
|
|
|
- $data['url']='https://www.westkiss.com/';
|
|
|
- $data['type']=0;
|
|
|
- $data1['url']='https://www.baidu.com/';
|
|
|
- $data1['type']=2;
|
|
|
- $data2=array("foo" => "bar");
|
|
|
- $notification->setIosAttachments($data);
|
|
|
- $notification->setApnsAlert($data1);
|
|
|
- $notification->setData($data2);
|
|
|
+ $data['push_para']=$url;
|
|
|
+ $data['push_type']=$type;
|
|
|
+ $notification->setData($data);
|
|
|
+ $notification->setSubtitle($title);
|
|
|
return $notification;
|
|
|
}
|
|
|
|
|
@@ -96,9 +97,7 @@ class Message extends Api
|
|
|
$data['uptime']=time();
|
|
|
Db::name('message')->where($where)->update($data);
|
|
|
}
|
|
|
- $template_dsc =$one_push['template_dsc'];
|
|
|
- $segment =$one_push['group_name'];
|
|
|
- $result =$this->send($template_dsc,$segment);
|
|
|
+ $result =$this->send($one_push);
|
|
|
print_r($result);
|
|
|
}
|
|
|
|