|
@@ -92,6 +92,14 @@ class PushService
|
|
$client = new HwPushCommon($pushAppId, getProp($pushApp, 'app_secret'));
|
|
$client = new HwPushCommon($pushAppId, getProp($pushApp, 'app_secret'));
|
|
$client->subscribeTopic(PushConst::TOPIC_ALL, [$regId]);
|
|
$client->subscribeTopic(PushConst::TOPIC_ALL, [$regId]);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if ($provider === PushConst::PROVIDER_OPPO) {
|
|
|
|
+ $appKey = getProp($pushApp, 'app_key');
|
|
|
|
+ $masterSecret = getProp($pushApp, 'master_secret');
|
|
|
|
+ $client = new OPPOPushCommon($appKey, $masterSecret);
|
|
|
|
+ $client->subscribeTags($regId, PushConst::TOPIC_ALL);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -211,7 +219,7 @@ class PushService
|
|
try {
|
|
try {
|
|
|
|
|
|
switch ($provider) {
|
|
switch ($provider) {
|
|
-
|
|
+
|
|
case PushConst::PROVIDER_HW:
|
|
case PushConst::PROVIDER_HW:
|
|
|
|
|
|
$target = env('APP_ENV') === 'production' ? 2 : 1;
|
|
$target = env('APP_ENV') === 'production' ? 2 : 1;
|
|
@@ -225,18 +233,18 @@ class PushService
|
|
|
|
|
|
$result = $client->sendPushMessage($title, $content, $url);
|
|
$result = $client->sendPushMessage($title, $content, $url);
|
|
break;
|
|
break;
|
|
-
|
|
+
|
|
case PushConst::PROVIDER_MI:
|
|
case PushConst::PROVIDER_MI:
|
|
$client = new MiPushCommon($package, $appSecret);
|
|
$client = new MiPushCommon($package, $appSecret);
|
|
$result = $client->sendMessageToAll($title, $content, $url);
|
|
$result = $client->sendMessageToAll($title, $content, $url);
|
|
break;
|
|
break;
|
|
-
|
|
+
|
|
case PushConst::PROVIDER_OPPO:
|
|
case PushConst::PROVIDER_OPPO:
|
|
$client = new OPPOPushCommon($appKey, $masterSecret);
|
|
$client = new OPPOPushCommon($appKey, $masterSecret);
|
|
$messageId = $client->getMessageId($title, $content, $url);
|
|
$messageId = $client->getMessageId($title, $content, $url);
|
|
- $result = $client->broadCastAll($messageId);
|
|
+ $result = $client->broadCastAll($messageId, $topic);
|
|
break;
|
|
break;
|
|
-
|
|
+
|
|
case PushConst::PROVIDER_VIVO:
|
|
case PushConst::PROVIDER_VIVO:
|
|
$client = new VPush($appId, $appKey, $appSecret);
|
|
$client = new VPush($appId, $appKey, $appSecret);
|
|
$client->setPushData($title, $content, $url);
|
|
$client->setPushData($title, $content, $url);
|