gxc
2019-12-03 642fcdaeb496d9a8f3154e17fd76005be3fcf197
ZigbeeApp/Home.Ios/AppDelegate.cs
File was renamed from ZigbeeApp/GateWay.Ios/AppDelegate.cs
@@ -1,19 +1,15 @@
using System;
using Foundation;
using UIKit;
using Shared;
using System;
using ObjCRuntime;
using UserNotifications;
using Shared.Common;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Shared;
using Shared.Common;
using Shared.IOS.TBL;
using UIKit;
namespace GateWay.Ios
namespace Home.IOS
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the
    // User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
    [Register("AppDelegate")]
    public class AppDelegate : BaseApplicationDelegate 
    {
@@ -32,9 +28,11 @@
            //base.FinishedLaunching(application, launchOptions);
            Shared.Application.FontSize = 12;
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            rootViewController = new UINavigationController(new MainViewController()) { NavigationBarHidden = true };
            rootViewController = new UINavigationController(new GateWay.Ios.MainViewController()) { NavigationBarHidden = true };
            Window.RootViewController = rootViewController;
            Window.MakeKeyAndVisible();
            Shared.IOS.TBL.WXApi.RegisterApp("wx2ec8f53f6fa36e82", "https://hdlcontrol.com/ZigbeeApp/");
            Shared.IOS.TBL.WXApi.RegisterApp("wx2ec8f53f6fa36e82", "https://hdlcontrol.com/ZigbeeApp/");
@@ -80,6 +78,7 @@
                }
            }
            AppCenter.Start("0ca801a2-742b-42fb-ba10-7ba4391371aa", typeof(Analytics), typeof(Crashes));
            GDMapKit.setGDApiKey("866fae25f336bc8d9a79b1d19267fffb");//高德地图key
            return true;
        }
@@ -157,11 +156,16 @@
        public override void ReceivedRemoteNotification (UIApplication application, NSDictionary userInfo)
        {
            Console.WriteLine(userInfo);
            if (application.ApplicationState == UIApplicationState.Active) {
            if (application.ApplicationState == UIApplicationState.Active)
            {
                System.Console.WriteLine ("ReceivedRemoteNotification1");
             } else if (application.ApplicationState == UIApplicationState.Background) {
            }
            else if (application.ApplicationState == UIApplicationState.Background)
            {
                System.Console.WriteLine ("ReceivedRemoteNotification2");
             } else if (application.ApplicationState == UIApplicationState.Inactive) {
            }
            else if (application.ApplicationState == UIApplicationState.Inactive)
            {
                System.Console.WriteLine ("ReceivedRemoteNotification3");
             }
        }
@@ -246,7 +250,8 @@
                                var result = new System.Net.WebClient { }.DownloadString($"https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx2ec8f53f6fa36e82&secret=a08585cd6ff2ce64570b9e7e6525dd8e&code={((SendAuthResp)resp).Code}&grant_type=authorization_code");
                                RespAction?.Invoke(result);
                            }
                            catch {
                            catch
                            {
                                RespAction?.Invoke(null);
                            }
                            break;
@@ -274,7 +279,7 @@
        {
            if (scanner == null)
            {
                scanner = new ZXing.Mobile.MobileBarcodeScanner(GateWay.Ios.AppDelegate.rootViewController) { FlashButtonText = "", TopText = topText, BottomText = bottomText, CancelButtonText = cancel };
                scanner = new ZXing.Mobile.MobileBarcodeScanner(Home.IOS.AppDelegate.rootViewController) { FlashButtonText = "", TopText = topText, BottomText = bottomText, CancelButtonText = cancel };
            }
            var result = await scanner.Scan();
@@ -294,7 +299,7 @@
                {
                    Width = width,
                    Height = height,
                    Margin = 10
                    Margin = 0
                }
            };
@@ -309,5 +314,3 @@
        }
    }
}