瀏覽代碼

PRS MOBILE - error logging for ios

Nick-PRSDigital@bitbucket.org 2 年之前
父節點
當前提交
2ba73fbf25

+ 4 - 0
prs.mobile/comal.timesheets.iOS/Info.plist

@@ -89,5 +89,9 @@
 			<string>Viewer</string>
 		</dict>
 	</array>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>mailto</string>
+	</array>
 </dict>
 </plist>

+ 2 - 28
prs.mobile/comal.timesheets/Main/MainPage.xaml.cs

@@ -89,8 +89,7 @@ namespace comal.timesheets
                 firstLoad = false;
                 //if (GlobalVariables.EmpID == Guid.Parse("40f6ccd9-5272-4b1a-99bf-de7542205aac"))
                 //    RunCustomScript();
-                NotifyChanges();
-                SendErrors();
+                NotifyChanges()              
             }
             catch (Exception e)
             {
@@ -99,32 +98,7 @@ namespace comal.timesheets
             NavigationPage.SetHasBackButton(this, false);
         }
 
-        private void SendErrors()
-        {
-            try
-            {
-                const string errorFilename = "Fatal.log";
-                var libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
-                var errorFilePath = Path.Combine(libraryPath, errorFilename);
-
-                if (!File.Exists(errorFilePath))
-                {
-                    return;
-                }
-
-                var errorText = File.ReadAllText(errorFilePath);
-
-                Notification n = new Notification();
-                n.Title = "Error log from " + GlobalVariables.EmpName;
-                n.Description = errorText;
-                n.Employee.ID = Guid.Parse("40f6ccd9-5272-4b1a-99bf-de7542205aac");
-
-                new Client<Notification>().Save(n, "Error from mobile");
-
-                File.Delete(errorFilePath);
-            }
-            catch { }
-        }
+        
 
         private void RunCustomScript()
         {

+ 6 - 1
prs.mobile/comal.timesheets/Main/Settings.xaml.cs

@@ -346,7 +346,12 @@ namespace comal.timesheets
             try
             {
                 const string errorFilename = "Fatal.log";
-                var libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+                string libraryPath = "";
+                if (Device.RuntimePlatform.Equals(Device.Android))               
+                    libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);               
+                else if (Device.RuntimePlatform.Equals(Device.iOS))               
+                    libraryPath = Environment.GetFolderPath(Environment.SpecialFolder.Resources);
+                                
                 var errorFilePath = Path.Combine(libraryPath, errorFilename);
 
                 if (!File.Exists(errorFilePath))