|
@@ -87,19 +87,30 @@ class PushService
|
|
|
// 初始化push_users
|
|
|
QappPushUser::initPushUser($uid, $regId, $pushAppId, $provider, $channelId);
|
|
|
|
|
|
+ # 推送相关变量
|
|
|
+ $topic = PushConst::TOPIC_ALL;
|
|
|
+ $appId = getProp($pushApp, 'app_id');
|
|
|
+ $appSecret = getProp($pushApp, 'app_secret');
|
|
|
+ $appKey = getProp($pushApp, 'app_key');
|
|
|
+ $masterSecret = getProp($pushApp, 'master_secret');
|
|
|
+
|
|
|
// 针对华为用户需要主动订阅topic,方便后续全量推送
|
|
|
if ($provider === PushConst::PROVIDER_HW) {
|
|
|
- $client = new HwPushCommon($pushAppId, getProp($pushApp, 'app_secret'));
|
|
|
- $client->subscribeTopic(PushConst::TOPIC_ALL, [$regId]);
|
|
|
+ $client = new HwPushCommon($pushAppId, $appSecret);
|
|
|
+ $client->subscribeTopic($topic, [$regId]);
|
|
|
}
|
|
|
|
|
|
// 针对OPPO用户需要主动订阅topic,方便后续全量推送
|
|
|
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);
|
|
|
+ $client = new OPPOPushCommon($appKey, $masterSecret);
|
|
|
+ $client->subscribeTags($regId, $topic);
|
|
|
}
|
|
|
+
|
|
|
+ // 针对VIVO用户需要主动订阅topic,方便后续全量推送
|
|
|
+ // if ($provider === PushConst::PROVIDER_OPPO) {
|
|
|
+ // $client = new VPush($appId, $appKey, $appSecret);
|
|
|
+ // $client->addTagForUsers($topic, [$regId]);
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
// 更新用户数据库中reg_id
|