| | |
| | | using System;
|
| | | using System; |
| | | using Foundation; |
| | | using Microsoft.AppCenter; |
| | | using Microsoft.AppCenter.Analytics; |
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic != null) |
| | | { |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (!string.IsNullOrEmpty(hiddenJson))
|
| | | {
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | // VideoMethod(hiddenJson); |
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic != null) |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | } |
| | | } |
| | | |
| | | }
|
| | | }
|
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | AppCenter.Start("0ca801a2-742b-42fb-ba10-7ba4391371aa", typeof(Analytics), typeof(Crashes)); |
| | | GDMapKit.setGDApiKey("866fae25f336bc8d9a79b1d19267fffb");//高德地图key |
| | | GDMapKit.setGDApiKey("3889cdfa4ef10c0d43348ffa2c1017c8");//高德地图key |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (string.IsNullOrEmpty(hiddenJson))
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | {
|
| | |
|
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | VideoMethod(hiddenJson);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | //不下线 |
| | | return; |
| | | } |
| | | else |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | //强制下线 |
| | | CommonPage.Instance.SingOut(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine); |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //强制下线 |
| | | CommonPage.Instance.SingOut(); |
| | | CommonPage.Instance.ShowErrorInfoAlert(Shared.R.MyInternationalizationString.uHadBeenLoginAndOffLine); |
| | | }
|
| | | } |
| | | } |
| | | } |
| | |
| | | NSString key_hiddenJson = new NSString("HiddenJson"); |
| | | if (userInfo.ContainsKey(key_hiddenJson)) |
| | | { |
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | return; |
| | | } |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | |
|
| | | var hiddenJson = userInfo["HiddenJson"].ToString();
|
| | | if (string.IsNullOrEmpty(hiddenJson)) {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (hiddenJson.Contains("cmtID"))
|
| | | {
|
| | | ///目前根据这个判断是否是可视对讲数据
|
| | | VideoMethod(hiddenJson);
|
| | | }
|
| | | else
|
| | | {
|
| | |
|
| | | NSDictionary hiddenJsonDic = userInfo["HiddenJson"] as NSDictionary; |
| | | if (hiddenJsonDic == null) |
| | | { |
| | | //不下线 |
| | | return; |
| | | } |
| | | else |
| | | NSString key_Offline = new NSString("Offline"); |
| | | if (hiddenJsonDic.ContainsKey(key_Offline)) |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | string signOut = hiddenJsonDic["Offline"].ToString(); |
| | | |
| | | if (signOut == "0") |
| | | { |
| | | //不下线 |
| | | } |
| | | else |
| | | { |
| | | //标记下线 |
| | | haveToSignOut = true; |
| | | }
|
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | completionHandler(UIBackgroundFetchResult.NewData); |
| | | }
|
| | | /// <summary>
|
| | | /// ios通知栏点击打开可视对讲的方法
|
| | | /// </summary>
|
| | | /// <param name="hiddenJson">云端推过来的数据</param>
|
| | | private void VideoMethod(string hiddenJson)
|
| | | {
|
| | |
|
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(hiddenJson);
|
| | | if (json == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | GateWay.Ios.ESVideoInfo eSVideoInfo = new GateWay.Ios.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);
|
| | | }
|
| | | GateWay.Ios.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);
|
| | | } |
| | | |
| | | public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) |
| | |
| | | |
| | | public override void WillEnterForeground(UIApplication application) |
| | | { |
| | | var internetStatus = GateWay.Ios.Reachability.InternetConnectionStatus(); |
| | | Shared.Phone.UserCenter.HdlWifiLogic.Current.NetworkStateChanged((int)internetStatus); |
| | | |
| | | //ZigBee.Common.Application.FindGateWaySocket.Start(); |
| | | // Called as part of the transiton from background to active state. |
| | | // Here you can undo many of the changes made on entering the background. |
| | | System.Console.WriteLine("WillEnterForeground"); |