bianjunhui 1 년 전
부모
커밋
93c7e28366
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      application/api/controller/Send.php

+ 7 - 4
application/api/controller/Send.php

@@ -24,6 +24,7 @@ use app\common\model\User;
 use think\Db;
 use think\Queue;
 use think\Request;
+use think\log;
 class Send extends Api
 {
     protected $noNeedLogin = ['*'];
@@ -88,7 +89,7 @@ class Send extends Api
         $this->success('',$result);
     }
 
-    function createNotification($appId){
+    function createNocation($appId){
         $title='Westkiss live is on air now🔔';
         $template_dsc='What does the Live Stream have? Most popular wigs! Best price! Exclusive events!
 Join the live now!';
@@ -97,6 +98,7 @@ Join the live now!';
         $notification = new Notification();
         $notification->setAppId($appId);
         $notification->setContents($content);
+        $notification->setIncludedSegments(['All']);
         $notification->setIosBadgeType('Increase');
         $notification->setIosBadgeCount(1);
         $notification->setIsIos(true);
@@ -113,8 +115,9 @@ Join the live now!';
     }
     public function sendMessage($apiInstance,$appId){
         $notification = $this->createNocation($appId);
-        $re=array();
-        for($i=0;$i<10;$i++){
+        $re=$apiInstance->createNotification($notification);
+        log::write($re,'info');
+        /*for($i=0;$i<10;$i++){
             $dt = new DateTime();
             $minute = 1+$i ;
             $dt->modify("+$minute minute");
@@ -124,7 +127,7 @@ Join the live now!';
             ];
             $notification->setFilters($filters);
             $re[] = $apiInstance->createNotification($notification);
-        }
+        }*/
         return $re;
     }