Wang Chen пре 4 година
родитељ
комит
528e488c01
2 измењених фајлова са 18 додато и 0 уклоњено
  1. 13 0
      app/Console/Commands/Push/PushTest.php
  2. 5 0
      app/Consts/PushConst.php

+ 13 - 0
app/Console/Commands/Push/PushTest.php

@@ -7,6 +7,7 @@ namespace App\Console\Commands\Push;
 use App\Consts\PushConst;
 use App\Libs\Push\HuaWei\HwPushCommon;
 use App\Libs\Push\OPPOPush\OPPOPushCommon;
+use App\Libs\Push\VPush\VPush;
 use App\Libs\Push\XMPush\MiPushCommon;
 use App\Modules\Push\Models\QappPushApp;
 use App\Modules\Push\Models\QappPushUser;
@@ -107,6 +108,18 @@ class PushTest extends Command
                     $client->setRegArr($regIdList);
                     $result = $client->broadCastRegIds($messageId);
                     break;
+                // VIVO
+                case PushConst::PROVIDER_VIVO:
+                    // 初始化oppo推送
+                    $client = new VPush($appId, $appKey, $appSecret);
+
+                    // 设置相关推送数据,保存消息内容
+                    $client->setPushData($title, $content, $url, $regIdList);
+                    $client->saveListPayload();
+
+                    // 循环推送
+                    $result = $client->sendMessage();
+                    break;
             }
         } catch (Exception $e) {
             var_dump($e->getMessage());

+ 5 - 0
app/Consts/PushConst.php

@@ -42,6 +42,11 @@ class PushConst
     const PROVIDER_OPPO = 'oppo';
 
     /**
+     * vivo服务商
+     */
+    const PROVIDER_VIVO = 'vivo';
+
+    /**
      * 准备推送
      */
     const STATUS_TODO = 1;