From 0b616cd842c3066767cc6ea8f709c5fd6e0c2d99 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 03 六月 2020 10:10:28 +0800
Subject: [PATCH] 2020-06-03 1.增加极光推送功能。

---
 SmartHome/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/SmartHome/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs b/SmartHome/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
index 434a3b6..7ef2e37 100644
--- a/SmartHome/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
+++ b/SmartHome/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
@@ -252,12 +252,21 @@
 #if __IOS__
                                                 DeviceType = "iphone";
 #endif
-                                                string jsonString = "{" +
-                                                      "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," +
-                                                      "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," +
-                                                      "\"Account\":" + "\"" + account + "\"" +
-                                                                       "}";
-                                                MainPage.RequestHttps (@"AddRegID", jsonString, true);
+                                                var mAddRegIDObj = new AddRegIDObj () {
+                                                    RegID = UserConfig.Instance.tokenID,
+                                                    Alias = UserConfig.Instance.phoneName,
+                                                    Account = account,
+                                                    UserMode = 2,
+                                                };
+                                                var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj);
+                                                MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false);
+
+                                                //string jsonString = "{" +
+                                                //      "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," +
+                                                //      "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," +
+                                                //      "\"Account\":" + "\"" + account + "\"" +
+                                                //                       "}";
+                                                //MainPage.RequestHttps (@"AddRegID", jsonString, true);
 #if wallon
 #else
                                                 if (!string.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) {
@@ -1391,12 +1400,21 @@
 #if __IOS__
                                 DeviceType = "iphone";
 #endif
-                                string jsonString = "{" +
-                                                      "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," +
-                                                      "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," +
-                                                      "\"Account\":" + "\"" + account + "\"" +
-                                                       "}";
-                                MainPage.RequestHttps (@"AddRegID", jsonString, true);
+                                var mAddRegIDObj = new AddRegIDObj () {
+                                    RegID = UserConfig.Instance.tokenID,
+                                    Alias = UserConfig.Instance.phoneName,
+                                    Account = account,
+                                    UserMode = 2,
+                                };
+                                var mAddRegIDObjJson = Newtonsoft.Json.JsonConvert.SerializeObject (mAddRegIDObj);
+                                MainPage.RequestHttps (@"AddRegID", mAddRegIDObjJson, true, false);
+
+                                //string jsonString = "{" +
+                                //                      "\"RegID\":" + "\"" + UserConfig.Instance.tokenID + "\"" + "," +
+                                //                      "\"Alias\":" + "\"" + UserConfig.Instance.phoneName + "\"" + "," +
+                                //                      "\"Account\":" + "\"" + account + "\"" +
+                                //                       "}";
+                                //MainPage.RequestHttps (@"AddRegID", jsonString, true);
 #if wallon
 #else
                                 if (!string.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) {

--
Gitblit v1.8.0