鸿蒙平台,添加是否支持推送音视频消息的配置
This commit is contained in:
@@ -12,6 +12,7 @@ public class HMConfig {
|
||||
private String iss;
|
||||
private String kid;
|
||||
private String projectId;
|
||||
private boolean supportVoipPush = false;
|
||||
|
||||
public String getPrivateKey() {
|
||||
return privateKey;
|
||||
@@ -44,4 +45,12 @@ public class HMConfig {
|
||||
public void setProjectId(String projectId) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public boolean isSupportVoipPush() {
|
||||
return supportVoipPush;
|
||||
}
|
||||
|
||||
public void setSupportVoipPush(boolean supportVoipPush) {
|
||||
this.supportVoipPush = supportVoipPush;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class HMPushServiceImpl implements HMPushService {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (pushMessage.pushMessageType == PushMessageType.PUSH_MESSAGE_TYPE_VOIP_INVITE || pushMessage.pushMessageType == PushMessageType.PUSH_MESSAGE_TYPE_VOIP_BYE) {
|
||||
if (config.isSupportVoipPush() && pushMessage.pushMessageType == PushMessageType.PUSH_MESSAGE_TYPE_VOIP_INVITE || pushMessage.pushMessageType == PushMessageType.PUSH_MESSAGE_TYPE_VOIP_BYE) {
|
||||
VoipPayload voipPayload = VoipPayload.buildAlertPayload(pushMessage);
|
||||
String response = httpPost(this.pushUrl, jwt, 10, voipPayload.toString(), 10000, 10000);
|
||||
LOG.info("Push voip message to {} response {}", pushMessage.getDeviceToken(), response);
|
||||
|
||||
Reference in New Issue
Block a user