From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Home.Ios/AppDelegate.cs | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ZigbeeApp/Home.Ios/AppDelegate.cs b/ZigbeeApp/Home.Ios/AppDelegate.cs index 58c9d0b..3db7bf3 100644 --- a/ZigbeeApp/Home.Ios/AppDelegate.cs +++ b/ZigbeeApp/Home.Ios/AppDelegate.cs @@ -7,6 +7,7 @@ using Shared.Common; using Shared.IOS.TBL; using UIKit; + namespace Home.IOS { [Register("AppDelegate")] @@ -24,8 +25,10 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { - //Shared.IOS.HDLFVSDK.Video.FVapplication(application, launchOptions); - Shared.IOS.HDLFVSDK.Video.ShowVideo(); + //鍏ㄨ閫氳皟鐢‵inishedLaunch + Shared.IOS.HDLFVSDK.Video.FVapplication(application,new NSDictionary()); + + Shared.Application.IsGpsEnable = false; Shared.Application.IsMusicEnable = false; base.FinishedLaunching(application, launchOptions); @@ -49,6 +52,7 @@ haveToSignOut = false; if (launchOptions != null) { + // check for a remote notification if (launchOptions.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) { @@ -111,8 +115,11 @@ } public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler) { + if (userInfo == null) { + //var alert = new Alert("", "userInfo涓虹┖", ""); + //alert.Show(); return; } Console.WriteLine(userInfo); @@ -120,9 +127,16 @@ if (application.ApplicationState == UIApplicationState.Active || application.ApplicationState == UIApplicationState.Background) { NSString key_hiddenJson = new NSString("HiddenJson"); + //var alert1 = new Alert("", "鏀跺埌鎺ㄩ�佷簡", ""); + //alert1.Show(); if (userInfo.ContainsKey(key_hiddenJson)) { - var hiddenJson = userInfo["HiddenJson"].ToString(); + + var hiddenJson = userInfo["HiddenJson"].ToString(); + + //var alert = new Alert("", hiddenJson, ""); + //alert.Show(); + if (string.IsNullOrEmpty(hiddenJson)) { return; @@ -132,7 +146,7 @@ { ///鐩墠鏍规嵁杩欎釜鍒ゆ柇鏄惁鏄彲瑙嗗璁叉暟鎹� - VideoMethod(hiddenJson); + //VideoMethod(hiddenJson); } else { @@ -175,7 +189,7 @@ if (hiddenJson.Contains("cmtID")) { ///鐩墠鏍规嵁杩欎釜鍒ゆ柇鏄惁鏄彲瑙嗗璁叉暟鎹� - VideoMethod(hiddenJson); + //VideoMethod(hiddenJson); } else { @@ -246,6 +260,7 @@ public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo) { + Console.WriteLine(userInfo); if (application.ApplicationState == UIApplicationState.Active) { @@ -268,6 +283,7 @@ // or when the user quits the application and it begins the transition to the background state. // Games should use this method to pause the game. base.OnResignActivation(application); + Shared.IOS.HDLFVSDK.Video.FVapplicationWillResignActive(application); } public override void DidEnterBackground(UIApplication application) @@ -277,6 +293,7 @@ //Shared.BusSocket.Stop ();On鍦ㄨ繖閲屽仠姝usSocket ZigBee.Common.Application.FindGateWaySocket.Stop(); base.DidEnterBackground(application); + Shared.IOS.HDLFVSDK.Video.FVapplicationDidEnterBackground(application); } public override void WillEnterForeground(UIApplication application) @@ -292,8 +309,11 @@ base.WillEnterForeground(application); } + public override void OnActivated(UIApplication application) { + //鍏ㄨ閫氳皟鐢˙ecomeActive + Shared.IOS.HDLFVSDK.Video.FVapplicationDidBecomeActive(application); // Restart any tasks that were paused (or not yet started) while the application was inactive. // If the application was previously in the background, optionally refresh the user interface. base.OnActivated(application); @@ -306,6 +326,9 @@ } //妫�鏌ヨ繛鎺ヨ繙绋� //浠g爜 + + //娓呴櫎瑙掓爣 + CommonPage.Instance.clearBadgeNum(); } public override void WillTerminate(UIApplication application) -- Gitblit v1.8.0