From df30e8562e49b45e7a9a3497d368cebd6085be87 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 十二月 2019 17:33:33 +0800
Subject: [PATCH] 2019-12-30-2
---
ZigbeeApp/GateWay.Ios/AppDelegate.cs | 56 +++-----------------------------------------------------
1 files changed, 3 insertions(+), 53 deletions(-)
diff --git a/ZigbeeApp/GateWay.Ios/AppDelegate.cs b/ZigbeeApp/GateWay.Ios/AppDelegate.cs
old mode 100755
new mode 100644
index 604e0e3..566871a
--- a/ZigbeeApp/GateWay.Ios/AppDelegate.cs
+++ b/ZigbeeApp/GateWay.Ios/AppDelegate.cs
@@ -4,12 +4,10 @@
using System;
using ObjCRuntime;
using UserNotifications;
-using Shared.Common;
+//using Shared.Common;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
-using Shared.IOS.TBL;
-
namespace GateWay.Ios
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
@@ -36,10 +34,9 @@
Window.RootViewController = rootViewController;
Window.MakeKeyAndVisible();
- Shared.IOS.TBL.WXApi.RegisterApp("wx2ec8f53f6fa36e82", "https://hdlcontrol.com/ZigbeeApp/");
-
DeviceTokenAction += (deviceToken) =>
{
+
Shared.Common.Config.Instance.RegistrationID = deviceToken;
};
haveToSignOut = false;
@@ -80,6 +77,7 @@
}
}
AppCenter.Start("0ca801a2-742b-42fb-ba10-7ba4391371aa", typeof(Analytics), typeof(Crashes));
+ GDMapKit.setGDApiKey("866fae25f336bc8d9a79b1d19267fffb");//楂樺痉鍦板浘key
return true;
}
@@ -213,54 +211,6 @@
{
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
base.WillTerminate(application);
- }
-
- public static Action<string> RespAction;
- public static void WXLogin()
- {
-
-
- var req = new SendAuthReq { Scope = "snsapi_userinfo", State = "ZigbeeApp", OpenID = "0c806938e2413ce73eef92cc3" };
- WXApi.SendAuthReq(req, rootViewController, null, null);
-
- }
-
- MyWXApiDelegate myWXApiDelegate = new MyWXApiDelegate { };
-
- class MyWXApiDelegate : WXApiDelegate
- {
- public override void OnReq(BaseReq req)
- {
-
- }
- public override void OnResp(BaseResp resp)
- {
- if (resp is SendAuthResp)
- {
- var sendAuthResp = resp as SendAuthResp;
- switch (sendAuthResp.ErrCode)
- {
- case 0:
- try
- {
- 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 {
- RespAction?.Invoke(null);
- }
- break;
- default:
- RespAction?.Invoke(null);
- break;
- }
-
- }
- }
- }
- public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
- {
- return WXApi.HandleOpenUniversalLink(userActivity, myWXApiDelegate);
}
}
}
--
Gitblit v1.8.0