Wang Chen пре 4 година
родитељ
комит
1501ba7729
2 измењених фајлова са 8 додато и 7 уклоњено
  1. 2 2
      app/Libs/Push/VPush/VPush.php
  2. 6 5
      app/Modules/Push/Services/PushService.php

+ 2 - 2
app/Libs/Push/VPush/VPush.php

@@ -185,9 +185,9 @@ class VPush
             'networkType'     => $this->_networkType,
             'clientCustomMap' => (object)[],
             'tagExpression'   => [
-                'andTags' => [$tag],
+                'andTags' => [],
                 'notTags' => [],
-                'orTags'  => []
+                'orTags'  => [$tag]
             ]
         ];
 

+ 6 - 5
app/Modules/Push/Services/PushService.php

@@ -107,10 +107,10 @@ class PushService
             }
 
             // 针对VIVO用户需要主动订阅topic,方便后续全量推送
-            // if ($provider === PushConst::PROVIDER_OPPO) {
-            //     $client = new VPush($appId, $appKey, $appSecret);
-            //     $client->addTagForUsers($topic, [$regId]);
-            // }
+            if ($provider === PushConst::PROVIDER_OPPO) {
+                $client = new VPush($appId, $appKey, $appSecret);
+                $client->addTagForUsers($topic, [$regId]);
+            }
         }
 
         // 更新用户数据库中reg_id
@@ -259,7 +259,8 @@ class PushService
                     case PushConst::PROVIDER_VIVO:
                         $client = new VPush($appId, $appKey, $appSecret);
                         $client->setPushData($title, $content, $url);
-                        $result = $client->sendAll();
+                        // $result = $client->sendAll();
+                        $result = $client->tagPush($topic);
                         break;
                 }
             } catch (Exception $e) {