|
@@ -18,6 +18,7 @@ using PermissionStatus = Plugin.Permissions.Abstractions.PermissionStatus;
|
|
|
using InABox.Core;
|
|
|
using InABox.Clients;
|
|
|
using InABox.Configuration;
|
|
|
+using Comal.Classes;
|
|
|
|
|
|
namespace InABox.Mobile
|
|
|
{
|
|
@@ -65,10 +66,20 @@ namespace InABox.Mobile
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- SecureStorage.SetAsync(GlobalVariables.CacheURLString, App.Settings.URL);
|
|
|
- SecureStorage.SetAsync(GlobalVariables.CachePortString, App.Settings.Port.ToString());
|
|
|
- SecureStorage.SetAsync(GlobalVariables.CacheUserIDString, App.Settings.UserID);
|
|
|
- SecureStorage.SetAsync(GlobalVariables.CachePasswordString, App.Settings.Password);
|
|
|
+ if (!string.IsNullOrWhiteSpace(App.Settings.UserID))
|
|
|
+ SecureStorage.SetAsync(GlobalVariables.CacheUserIDString, App.Settings.UserID);
|
|
|
+
|
|
|
+ if (!string.IsNullOrWhiteSpace(App.Settings.Password))
|
|
|
+ SecureStorage.SetAsync(GlobalVariables.CachePasswordString, App.Settings.Password);
|
|
|
+
|
|
|
+ if (App.DBSettings.URLs.Count() > 0)
|
|
|
+ SecureStorage.SetAsync(GlobalVariables.CacheSettingsURL1, App.DBSettings.URLs[0]);
|
|
|
+
|
|
|
+ if (App.DBSettings.URLs.Count() > 1)
|
|
|
+ SecureStorage.SetAsync(GlobalVariables.CacheSettingsURL2, App.DBSettings.URLs[1]);
|
|
|
+
|
|
|
+ if (App.DBSettings.URLs.Count() > 2)
|
|
|
+ SecureStorage.SetAsync(GlobalVariables.CacheSettingsURL3, App.DBSettings.URLs[2]);
|
|
|
}
|
|
|
catch { }
|
|
|
}
|
|
@@ -100,14 +111,17 @@ namespace InABox.Mobile
|
|
|
catch (Exception e)
|
|
|
{
|
|
|
if (String.IsNullOrWhiteSpace(App.Settings.URL))
|
|
|
- LoadDemoSettings(App.Settings);
|
|
|
+ LoadDemoSettings(App.DBSettings);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void LoadDemoSettings(ConnectionSettings settings)
|
|
|
+ public static void LoadDemoSettings(DatabaseSettings settings)
|
|
|
{
|
|
|
- settings.URL = "http://demo.prsdigital.com.au";
|
|
|
- settings.Port = 8003;
|
|
|
+ List<string> list = new List<string>();
|
|
|
+ list.Add("http://demo.prsdigital.com.au:8003");
|
|
|
+ list.Add("http://demo2.prsdigital.com.au:8003");
|
|
|
+ list.Add("http://demo3.prsdigital.com.au:8003");
|
|
|
+ settings.URLs = list.ToArray();
|
|
|
settings.UserID = "GUEST";
|
|
|
settings.Password = "guest";
|
|
|
}
|
|
@@ -161,7 +175,7 @@ namespace InABox.Mobile
|
|
|
catch (System.Threading.Tasks.TaskCanceledException ex)
|
|
|
{
|
|
|
return false;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
//request.Wait();
|
|
|
//var statuses = request.Result;
|
|
@@ -196,7 +210,7 @@ namespace InABox.Mobile
|
|
|
bool request = false;
|
|
|
if (permissionStatus == PermissionStatus.Denied)
|
|
|
{
|
|
|
- if (String.Equals(Device.RuntimePlatform,Device.iOS))
|
|
|
+ if (String.Equals(Device.RuntimePlatform, Device.iOS))
|
|
|
{
|
|
|
|
|
|
var title = $"{permission} Permission";
|
|
@@ -244,6 +258,6 @@ namespace InABox.Mobile
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|