陈嘉乐
2020-08-10 c2b68b777ddd4d9733e3bd64746929295c04ec45
ZigbeeApp/GateWay.Droid/Application.cs
@@ -247,6 +247,12 @@
        /// <param name="bundle">Bundle.</param>
        private void OpenNotification(Context context, Bundle bundle)
        {
            Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class);
            i.PutExtras(bundle);
            i.SetFlags(ActivityFlags.NewTask);
            context.StartActivity(i);
            String extras = bundle.GetString(JPushInterface.ExtraExtra);
            //String myValue = "";
            try
@@ -261,10 +267,7 @@
                System.Console.WriteLine(TAG, "Unexpected: extras is not a valid json", e);
                return;
            }
            Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class);
            i.PutExtras(bundle);
            i.SetFlags(ActivityFlags.NewTask);
            context.StartActivity(i);
            //if (TYPE_THIS.equals(myValue))
            //{
            //Intent mIntent = new Intent(context, ThisActivity.class);
@@ -282,42 +285,15 @@
        }
        /// <summary>
        /// android通知栏点击打开可视对讲的方法
        /// </summary>
        /// <param name="hiddenJson">云端推过来的数据</param>
        private void VideoMethod(string hiddenJson)
        {
            var json = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson);
            if (json == null)
            {
                return;
            }
            Shared.Phone.VideoPhone.ESVideoInfo eSVideoInfo = new Shared.Phone.VideoPhone.ESVideoInfo();
            if (json["uuid"].ToString().Contains(","))
            {
                var uuid = json["uuid"].ToString().Split(',');
                eSVideoInfo.ESVideoUUID = uuid[0];
            }
            else
            {
                eSVideoInfo.ESVideoUUID = json["uuid"].ToString();
            }
            eSVideoInfo.DeviceName = Language.StringByID(Shared.R.MyInternationalizationString.theOutdoorUnit);
            eSVideoInfo.ESRoomID = int.Parse(json["roomno"].ToString());
            if (!string.IsNullOrEmpty(json["unitno"].ToString()))
            {
                string str = json["unitno"].ToString();
                string str1 = str.Substring(0, 2).TrimStart('0');
                string str2 = str.Substring(2, 2).TrimStart('0');
                eSVideoInfo.RoomName = str1 + Language.StringByID(Shared.R.MyInternationalizationString.dong) + str2 + Language.StringByID(Shared.R.MyInternationalizationString.unit);
            }
            Shared.Phone.VideoPhone.ESVideo.ShowESvideoVideoIntercom(eSVideoInfo);
            //var url = "https://global.hdlcontrol.com/HangZhouHdlCloudApi/VideoIntercom/Answer";
            //var dd=await Shared.Phone.Device.Logic.Send.HttpWebRequest(url, json.ToString(), "POST", 3, true);
        /// <summary>         /// android通知栏点击打开可视对讲的方法         /// </summary>         /// <param name="hiddenJson">云端推过来的数据</param>         private void VideoMethod(string hiddenJson)         {                          var hiddanJson = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson);             if (hiddanJson == null)             {                 return;             }             var json = Newtonsoft.Json.Linq.JObject.Parse(hiddanJson["HiddanJson"].ToString());             if (json == null)             {                 return;             }             Shared.Phone.VideoPhone.ESVideoInfo eSVideoInfo = new Shared.Phone.VideoPhone.ESVideoInfo();             if (json["uuid"].ToString().Contains(","))             {                 var uuid = json["uuid"].ToString().Split(',');                 eSVideoInfo.ESVideoUUID = uuid[0];             }             else             {                 eSVideoInfo.ESVideoUUID = json["uuid"].ToString();             }             eSVideoInfo.DeviceName = Language.StringByID(Shared.R.MyInternationalizationString.theOutdoorUnit);             eSVideoInfo.ESRoomID = int.Parse(json["roomno"].ToString());             if (!string.IsNullOrEmpty(json["unitno"].ToString()))             {                 string str = json["unitno"].ToString();                 string str1 = str.Substring(0, 2).TrimStart('0');                 string str2 = str.Substring(2, 2).TrimStart('0');                 eSVideoInfo.RoomName = str1 + Language.StringByID(Shared.R.MyInternationalizationString.dong) + str2 + Language.StringByID(Shared.R.MyInternationalizationString.unit);             }             Shared.Phone.VideoPhone.ESVideo.ShowESvideoVideoIntercom(eSVideoInfo);
        }
    }
}