From b562a582ac3a288193e6e4f57c5eff8a344305a4 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 13:52:17 +0800
Subject: [PATCH] Update AndroidManifest.xml
---
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs | 133 +++++++++++++++++++++++++++++++++-----------
1 files changed, 99 insertions(+), 34 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
index 0a6aec7..e9393fd 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
@@ -16,6 +16,7 @@
/// </summary>
public class CommonMethod
{
+
private Loading loading;
/// <summary>
/// 璁板綍褰撳墠鐣岄潰绱㈠紩鍊�
@@ -54,6 +55,7 @@
this.SunThread(() =>
{
var list = this.GetVideoDoorLockLockModelsList("notAllowedConfigNetworkModels");
+
this.MainThread(() =>
{
#if __IOS__
@@ -75,7 +77,8 @@
#else
HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity, spk,list);
- HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, serials) =>
+ HDLEzvizSdk.SetAddCallback(new
+ AndroidIHdlInterface((isBool, serials) =>
{
if (isBool)
{
@@ -127,11 +130,12 @@
/// <param name="isDialog">鏄惁闇�瑕佸脊妗�</param>
public void SkipRTVActivity(string deviceSerial, string deviceId, string spk, bool isDialog)
{
-
+ this.Loading.Start();
this.InitializationAndroidData((isEzChildAccessToken) =>
{
this.MainThread(() =>
{
+ this.Loading.Hide();
if (isDialog)
{
Video.View.ShowDialog.Currnet.ClickBox(Language.StringByID(StringId.laizimenlinghujiao), (dialog) =>
@@ -163,7 +167,27 @@
EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk);
#else
- HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk);
+ HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk,"");
+#endif
+
+
+ }
+ /// <summary>
+ /// 鎵撳紑瀹炴椂瑙嗛鐢婚潰
+ /// </summary>
+ /// <param name="deviceSerial">璁惧搴忓垪鍙�</param>
+ /// <param name="deviceId">璁惧id(浜戠涓奷eviceId)</param>
+ /// <param name="spk">璁惧spk(浜戦泙涓婂畾涔夊ソ鐨�)</param>
+ /// <param name="msgId">娑堟伅id</param>
+ private void SkipRTVActivity(string deviceSerial, string deviceId, string spk, string msgId)
+ {
+
+#if __IOS__
+ //鎵撳紑钀ょ煶瑙嗛鐣岄潰
+ EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk, msgId);
+
+#else
+ HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk,msgId);
#endif
@@ -214,7 +238,7 @@
public void InitializationAndroidData(Action<bool> action)
{
bool isBool = true;
- this.Loading.Start();
+ //this.Loading.Start();
this.SunThread(() =>
{
try
@@ -227,14 +251,21 @@
{
//Token
isBool = false;
- this.ShowTip("鑾峰彇钀ょ煶浜戝瓙璐﹀彿token澶辫触銆�");
+ //this.ShowTip("鑾峰彇钀ょ煶浜戝瓙璐﹀彿token澶辫触銆�");
return;
}
+
+ string appKey = "1aa98a90489b4838b966b57018b4b04b";//姝e紡鏈嶅姟鍣�
+ //if (OnAppConfig.Instance.RequestHttpsHost == "https://test-gz.hdlcontrol.com")
+ //{
+ // appKey = "941b1b72b6294998acfd36c14931b675";//鐢ㄥ湪娴嬭瘯鏈嶅姟鍣ㄦ帹閫佺殑
+ //}
+
#if __IOS__
//iOS
//鍒濆鍖栬悿鐭充簯SDK锛屼腑鏂囧浗鍐卥ey銆佽嫳鏂囨捣澶杒ey 寮�鍙戣�呰处鍙蜂娇鐢ㄥ簲鐢ㄥ寘鍚嶇敵璇风殑APPKEY锛屼笉鍚屽寘鍚嶅簲鐢ㄩ渶閰嶇疆涓嶅悓鐨凙PPKEY
- EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
+ EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey(appKey, appKey);
//1.璁剧疆鎵�闇�娌充笢鐨凙ccessToken鍜孯efreshToken銆佸煙鍚嶅湴鍧�
EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken);
EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, DB_ResidenceData.Instance.CurrentRegion.id);
@@ -246,7 +277,9 @@
//info.de
//EZSDK.IOS.EZSDK.Play(info);
#else
- HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id);
+
+ HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, appKey, 1, DB_ResidenceData.Instance.CurrentRegion.id,
+ HttpUtil.APP_KEY, HttpUtil.SECRET_KEY);
#endif
@@ -261,7 +294,7 @@
{
this.MainThread(() =>
{
- this.Loading.Hide();
+ //this.Loading.Hide();
action?.Invoke(isBool);
});
}
@@ -279,6 +312,7 @@
#if __IOS__
#else
HDLEzvizSdk.Instance.SetHomeId(home.id);
+
#endif
}
@@ -290,7 +324,15 @@
/// <returns>杩斿洖缁撴灉涓嶄細涓簄ull</returns>
public List<string> GetVideoDoorLockLockModelsList(string mode = "lockModels")
{
- return VideDoorLockSend.Current.GetVideoDoorLockLockModelsList(mode);
+ var lockModels = VideDoorLockSend.Current.GetVideoDoorLockLockModelsList();
+ if (mode == "lockModels")
+ {
+ return lockModels.lockModels;
+ }
+ else
+ {
+ return lockModels.notAllowedConfigNetworkModels;
+ }
}
/// <summary>
/// 闂ㄩ攣鎺ㄩ��
@@ -302,30 +344,49 @@
this.MainThread(() =>
{
if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
- //{ "deviceSid":"J92513662","type":"opendoormsg","extDevId":"J92513662","deviceId":"1641010144999936001","spk":"security.door.ezviz"}
- var expantContent = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContent>(jpushMessageInfo.expantContent);
- if (expantContent == null)
+ try
{
- return;
- }
- if (expantContent.spk != SPK.VideoDoorLock)
+ //{ "deviceSid":"J92513662","type":"opendoormsg","extDevId":"J92513662","deviceId":"1641010144999936001","spk":"security.door.ezviz"}
+ var expantContent = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContent>(jpushMessageInfo.expantContent);
+ if (expantContent == null)
+ {
+ return;
+ }
+ if (expantContent.spk == null)
+ {
+ return;
+ }
+ if ( expantContent.spk != SPK.VideoDoorLock)
+ {
+ return;
+ }
+ if (jpushMessageInfo.messageType.Contains(PushMessageType.DOOR_BELL.ToString()))
+ {
+ ///鎵撳紑瑙嗛闂ㄩ攣
+ string currentTimeStr = Utlis.GetTimestamp(); // 褰撳墠鏃堕棿
+
+ if (string.IsNullOrEmpty(expantContent.currentTime) && string.IsNullOrEmpty(currentTimeStr) && (long.Parse(currentTimeStr) - long.Parse(expantContent.currentTime)) > 30000)
+ { // 瓒呮椂30s
+ this.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId, expantContent.spk, true);
+ }
+ else
+ {
+ this.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId, expantContent.spk, expantContent.msgId);
+ }
+ }
+ else if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString()))
+ {
+ //浣庣數閲忔帹閫�
+ this.UpdateDoorLockState(PushMessageType.Alarm);
+ }
+ else if (jpushMessageInfo.messageType.Contains(PushMessageType.Prompt.ToString()))
+ {
+ //寮�闂ㄦ帹閫�
+ this.UpdateDoorLockState(PushMessageType.Prompt);
+ }
+ }catch(Exception ex)
{
- return;
- }
- if (jpushMessageInfo.messageType.Contains(PushMessageType.DOOR_BELL.ToString()))
- {
- ///鎵撳紑瑙嗛闂ㄩ攣
- this.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId, expantContent.spk, true);
- }
- else if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString()))
- {
- //浣庣數閲忔帹閫�
- this.UpdateDoorLockState(PushMessageType.Alarm);
- }
- else if (jpushMessageInfo.messageType.Contains(PushMessageType.Prompt.ToString()))
- {
- //寮�闂ㄦ帹閫�
- this.UpdateDoorLockState(PushMessageType.Prompt);
+
}
});
@@ -398,11 +459,11 @@
if (comerom == Comerom.collect)
{
- return "FunctionIcon/DoorLock/VideoDoorLockOpen.png";
+ return "FunctionIcon/DoorLock/VideoDoorLockOpen1.png";
}
else
{
- return "FunctionIcon/DoorLock/VideoDoorlockClose.png";
+ return "FunctionIcon/DoorLock/VideoDoorlockClose1.png";
}
}
@@ -578,6 +639,7 @@
{
Action<bool,string> mAction;
+ Action<string> mDoorlockAnswer;
public AndroidIHdlInterface(Action<bool,string> action)
{
mAction = action;
@@ -592,7 +654,10 @@
mAction?.Invoke(p0,p1);
}
-
+ public void DoorlockAnswer(string p0)
+ {
+ mDoorlockAnswer?.Invoke(p0);
+ }
}
#endif
--
Gitblit v1.8.0