黄学彪
2019-11-25 160785587667cc0d927f85e44c139ec9dde13a9e
ZigbeeApp/Home.Ios/AppDelegate.cs
old mode 100755 new mode 100644
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,7 +28,7 @@
            //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();
@@ -157,11 +153,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 +247,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 +276,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 +296,7 @@
                {
                    Width = width,
                    Height = height,
                    Margin = 10
                    Margin = 0
                }
            };
@@ -309,5 +311,3 @@
        }
    }
}