diff --git a/WebServices/TodoREST/Droid/HttpClientHandlerService.cs b/WebServices/TodoREST/Droid/HttpClientHandlerService.cs new file mode 100644 index 0000000000..9e66f3f7b4 --- /dev/null +++ b/WebServices/TodoREST/Droid/HttpClientHandlerService.cs @@ -0,0 +1,22 @@ +using System.Net.Http; +using TodoREST.Droid; +using Xamarin.Forms; + +[assembly: Dependency(typeof(HttpClientHandlerService))] +namespace TodoREST.Droid +{ + public class HttpClientHandlerService : IHttpClientHandlerService + { + public HttpClientHandler GetInsecureHandler() + { + HttpClientHandler handler = new HttpClientHandler(); + handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => + { + if (cert.Issuer.Equals("CN=localhost")) + return true; + return errors == System.Net.Security.SslPolicyErrors.None; + }; + return handler; + } + } +} diff --git a/WebServices/TodoREST/Droid/MainActivity.cs b/WebServices/TodoREST/Droid/MainActivity.cs old mode 100755 new mode 100644 index a1c9d96e84..6fd8c31699 --- a/WebServices/TodoREST/Droid/MainActivity.cs +++ b/WebServices/TodoREST/Droid/MainActivity.cs @@ -18,15 +18,6 @@ protected override void OnCreate(Bundle bundle) Instance = this; global::Xamarin.Forms.Forms.Init(this, bundle); -#if DEBUG - System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => - { - if (certificate.Issuer.Equals("CN=localhost")) - return true; - return sslPolicyErrors == System.Net.Security.SslPolicyErrors.None; - }; -#endif - LoadApplication(new App()); } } diff --git a/WebServices/TodoREST/Droid/Properties/AndroidManifest.xml b/WebServices/TodoREST/Droid/Properties/AndroidManifest.xml index 30eced6087..325e01da9b 100644 --- a/WebServices/TodoREST/Droid/Properties/AndroidManifest.xml +++ b/WebServices/TodoREST/Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/WebServices/TodoREST/Droid/Resources/Resource.designer.cs b/WebServices/TodoREST/Droid/Resources/Resource.designer.cs index c89a4a70ca..da11e10bba 100644 --- a/WebServices/TodoREST/Droid/Resources/Resource.designer.cs +++ b/WebServices/TodoREST/Droid/Resources/Resource.designer.cs @@ -15,7 +15,7 @@ namespace TodoREST.Droid { - [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] public partial class Resource { diff --git a/WebServices/TodoREST/Droid/Resources/layout/Tabbar.axml b/WebServices/TodoREST/Droid/Resources/layout/Tabbar.axml old mode 100755 new mode 100644 diff --git a/WebServices/TodoREST/Droid/Resources/layout/Toolbar.axml b/WebServices/TodoREST/Droid/Resources/layout/Toolbar.axml old mode 100755 new mode 100644 diff --git a/WebServices/TodoREST/Droid/Resources/values/colors.xml b/WebServices/TodoREST/Droid/Resources/values/colors.xml old mode 100755 new mode 100644 diff --git a/WebServices/TodoREST/Droid/Resources/values/styles.xml b/WebServices/TodoREST/Droid/Resources/values/styles.xml old mode 100755 new mode 100644 diff --git a/WebServices/TodoREST/Droid/TodoREST.Droid.csproj b/WebServices/TodoREST/Droid/TodoREST.Droid.csproj index a82b7d0091..43af289674 100644 --- a/WebServices/TodoREST/Droid/TodoREST.Droid.csproj +++ b/WebServices/TodoREST/Droid/TodoREST.Droid.csproj @@ -29,7 +29,8 @@ 4 None false - System.Net.Http.HttpClientHandler + Xamarin.Android.Net.AndroidClientHandler + btls portable @@ -39,18 +40,19 @@ 4 false false - Xamarin.Android.Net.AndroidClientHandler + + false + - - 4.5.0.396 - + + @@ -62,8 +64,10 @@ + + @@ -88,4 +92,4 @@ - \ No newline at end of file + diff --git a/WebServices/TodoREST/Droid/app.config b/WebServices/TodoREST/Droid/app.config new file mode 100755 index 0000000000..4dd3b43c8e --- /dev/null +++ b/WebServices/TodoREST/Droid/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/WebServices/TodoREST/TodoAPI/TodoAPI/Properties/launchSettings.json b/WebServices/TodoREST/TodoAPI/TodoAPI/Properties/launchSettings.json index 6ada3f7a56..ac5ce133e4 100755 --- a/WebServices/TodoREST/TodoAPI/TodoAPI/Properties/launchSettings.json +++ b/WebServices/TodoREST/TodoAPI/TodoAPI/Properties/launchSettings.json @@ -1,4 +1,5 @@ { + "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, @@ -7,7 +8,6 @@ "sslPort": 44300 } }, - "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "IIS Express": { "commandName": "IISExpress", diff --git a/WebServices/TodoREST/TodoAPI/TodoAPI/TodoAPI.csproj b/WebServices/TodoREST/TodoAPI/TodoAPI/TodoAPI.csproj old mode 100755 new mode 100644 index 620efe2bb1..fb56226a0b --- a/WebServices/TodoREST/TodoAPI/TodoAPI/TodoAPI.csproj +++ b/WebServices/TodoREST/TodoAPI/TodoAPI/TodoAPI.csproj @@ -9,7 +9,10 @@ - + + all + true + diff --git a/WebServices/TodoREST/TodoREST.sln b/WebServices/TodoREST/TodoREST.sln index 2c182625e3..8b08a8fb99 100644 --- a/WebServices/TodoREST/TodoREST.sln +++ b/WebServices/TodoREST/TodoREST.sln @@ -1,15 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.168 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodoREST", "TodoREST\TodoREST.csproj", "{05A1AF58-41E1-4FFD-BB93-E8BA58BE5646}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoREST", "TodoREST\TodoREST.csproj", "{05A1AF58-41E1-4FFD-BB93-E8BA58BE5646}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoREST.iOS", "iOS\TodoREST.iOS.csproj", "{AF51FC57-8EE7-4615-92BB-6D0875D13F96}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoREST.Droid", "Droid\TodoREST.Droid.csproj", "{E648100F-B4E1-4AB7-AAA8-55B66DFFD821}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TodoAPI", "TodoAPI\TodoAPI\TodoAPI.csproj", "{C05CA11C-C283-4321-9E3C-05D306B59C13}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TodoAPI", "TodoAPI\TodoAPI\TodoAPI.csproj", "{C05CA11C-C283-4321-9E3C-05D306B59C13}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -111,30 +111,42 @@ Global {05A1AF58-41E1-4FFD-BB93-E8BA58BE5646}.Release|x86.ActiveCfg = Release|Any CPU {05A1AF58-41E1-4FFD-BB93-E8BA58BE5646}.Release|x86.Build.0 = Release|Any CPU {05A1AF58-41E1-4FFD-BB93-E8BA58BE5646}.Release|x86.Deploy.0 = Release|Any CPU - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|Any CPU.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|Any CPU.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|ARM.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|ARM.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhone.ActiveCfg = Release|iPhone - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhone.Build.0 = Release|iPhone - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x64.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x64.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x86.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x86.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|Any CPU.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|Any CPU.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|ARM.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|ARM.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhone.ActiveCfg = Release|iPhone - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhone.Build.0 = Release|iPhone - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x64.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x64.Build.0 = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x86.ActiveCfg = Release|iPhoneSimulator - {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x86.Build.0 = Release|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|Any CPU.Deploy.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|ARM.Build.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|ARM.Deploy.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Ad-Hoc|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x64.Build.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x64.Deploy.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x86.Build.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Ad-Hoc|x86.Deploy.0 = Ad-Hoc|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|Any CPU.Build.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|Any CPU.Deploy.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|ARM.ActiveCfg = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|ARM.Build.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|ARM.Deploy.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhone.ActiveCfg = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhone.Build.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhone.Deploy.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|iPhoneSimulator.Deploy.0 = AppStore|iPhoneSimulator + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x64.ActiveCfg = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x64.Build.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x64.Deploy.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x86.ActiveCfg = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x86.Build.0 = AppStore|iPhone + {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.AppStore|x86.Deploy.0 = AppStore|iPhone {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator {AF51FC57-8EE7-4615-92BB-6D0875D13F96}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator @@ -243,6 +255,102 @@ Global {E648100F-B4E1-4AB7-AAA8-55B66DFFD821}.Release|x86.ActiveCfg = Release|Any CPU {E648100F-B4E1-4AB7-AAA8-55B66DFFD821}.Release|x86.Build.0 = Release|Any CPU {E648100F-B4E1-4AB7-AAA8-55B66DFFD821}.Release|x86.Deploy.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|ARM.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|iPhone.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|x64.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|x64.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|x86.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.AppStore|x86.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|ARM.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|ARM.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|iPhone.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|x64.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|x64.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|x86.ActiveCfg = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Debug|x86.Build.0 = Debug|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|Any CPU.Build.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|ARM.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|ARM.Build.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|iPhone.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|iPhone.Build.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|x64.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|x64.Build.0 = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|x86.ActiveCfg = Release|Any CPU + {60581314-7F5A-4DD4-A889-9048DE3B4DF5}.Release|x86.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|ARM.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|iPhone.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|x64.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|x64.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|x86.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.AppStore|x86.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|ARM.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|ARM.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|iPhone.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|x64.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|x64.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|x86.ActiveCfg = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Debug|x86.Build.0 = Debug|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|Any CPU.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|ARM.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|ARM.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|iPhone.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|iPhone.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|x64.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|x64.Build.0 = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|x86.ActiveCfg = Release|Any CPU + {4886D55A-BCCD-416D-B296-70ED843F03CB}.Release|x86.Build.0 = Release|Any CPU {C05CA11C-C283-4321-9E3C-05D306B59C13}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {C05CA11C-C283-4321-9E3C-05D306B59C13}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {C05CA11C-C283-4321-9E3C-05D306B59C13}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -295,9 +403,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D798DBF5-BA75-4504-820F-90BDEEC5006F} - EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution Policies = $0 $0.DotNetNamingPolicy = $1 diff --git a/WebServices/TodoREST/TodoREST/Constants.cs b/WebServices/TodoREST/TodoREST/Constants.cs old mode 100755 new mode 100644 index 7d4dd6f081..646706c022 --- a/WebServices/TodoREST/TodoREST/Constants.cs +++ b/WebServices/TodoREST/TodoREST/Constants.cs @@ -2,10 +2,9 @@ namespace TodoREST { - public static class Constants - { - // The iOS simulator can connect to localhost. However, Android emulators must use the 10.0.2.2 special alias to your host loopback interface. - public static string BaseAddress = Device.RuntimePlatform == Device.Android ? "https://10.0.2.2:5001" : "https://localhost:5001"; - public static string TodoItemsUrl = BaseAddress + "/api/todoitems/{0}"; + public static class Constants + { + // URL of REST service + public static string RestUrl = Device.RuntimePlatform == Device.Android ? "https://10.0.2.2:5001/api/todoitems/{0}" : "https://localhost:5001/api/todoitems/{0}"; } } diff --git a/WebServices/TodoREST/TodoREST/Data/RestService.cs b/WebServices/TodoREST/TodoREST/Data/RestService.cs old mode 100755 new mode 100644 index a3e407b375..3e11ef6791 --- a/WebServices/TodoREST/TodoREST/Data/RestService.cs +++ b/WebServices/TodoREST/TodoREST/Data/RestService.cs @@ -5,28 +5,29 @@ using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; +using Xamarin.Forms; namespace TodoREST { public class RestService : IRestService { - HttpClient _client; + HttpClient client; public List Items { get; private set; } public RestService() { - _client = new HttpClient(); + client = new HttpClient(DependencyService.Get().GetInsecureHandler()); } public async Task> RefreshDataAsync() { Items = new List(); - var uri = new Uri(string.Format(Constants.TodoItemsUrl, string.Empty)); + var uri = new Uri(string.Format(Constants.RestUrl, string.Empty)); try { - var response = await _client.GetAsync(uri); + var response = await client.GetAsync(uri); if (response.IsSuccessStatusCode) { var content = await response.Content.ReadAsStringAsync(); @@ -43,7 +44,7 @@ public async Task> RefreshDataAsync() public async Task SaveTodoItemAsync(TodoItem item, bool isNewItem = false) { - var uri = new Uri(string.Format(Constants.TodoItemsUrl, string.Empty)); + var uri = new Uri(string.Format(Constants.RestUrl, string.Empty)); try { @@ -53,11 +54,11 @@ public async Task SaveTodoItemAsync(TodoItem item, bool isNewItem = false) HttpResponseMessage response = null; if (isNewItem) { - response = await _client.PostAsync(uri, content); + response = await client.PostAsync(uri, content); } else { - response = await _client.PutAsync(uri, content); + response = await client.PutAsync(uri, content); } if (response.IsSuccessStatusCode) @@ -74,11 +75,11 @@ public async Task SaveTodoItemAsync(TodoItem item, bool isNewItem = false) public async Task DeleteTodoItemAsync(string id) { - var uri = new Uri(string.Format(Constants.TodoItemsUrl, id)); + var uri = new Uri(string.Format(Constants.RestUrl, id)); try { - var response = await _client.DeleteAsync(uri); + var response = await client.DeleteAsync(uri); if (response.IsSuccessStatusCode) { diff --git a/WebServices/TodoREST/TodoREST/IHttpClientHandlerService.cs b/WebServices/TodoREST/TodoREST/IHttpClientHandlerService.cs new file mode 100644 index 0000000000..c1ec21b6a4 --- /dev/null +++ b/WebServices/TodoREST/TodoREST/IHttpClientHandlerService.cs @@ -0,0 +1,9 @@ +using System.Net.Http; + +namespace TodoREST +{ + public interface IHttpClientHandlerService + { + HttpClientHandler GetInsecureHandler(); + } +} diff --git a/WebServices/TodoREST/TodoREST/TodoREST.csproj b/WebServices/TodoREST/TodoREST/TodoREST.csproj index 0b5e20b37c..6acbe342c0 100644 --- a/WebServices/TodoREST/TodoREST/TodoREST.csproj +++ b/WebServices/TodoREST/TodoREST/TodoREST.csproj @@ -22,4 +22,4 @@ - \ No newline at end of file + diff --git a/WebServices/TodoREST/TodoREST/Views/TodoItemPage.xaml b/WebServices/TodoREST/TodoREST/Views/TodoItemPage.xaml old mode 100755 new mode 100644 diff --git a/WebServices/TodoREST/TodoREST/Views/TodoListPage.xaml b/WebServices/TodoREST/TodoREST/Views/TodoListPage.xaml old mode 100755 new mode 100644 index d6412b0a75..31532bc307 --- a/WebServices/TodoREST/TodoREST/Views/TodoListPage.xaml +++ b/WebServices/TodoREST/TodoREST/Views/TodoListPage.xaml @@ -1,6 +1,6 @@ @@ -12,22 +12,22 @@ - - - - + \ No newline at end of file diff --git a/WebServices/TodoREST/iOS/AppDelegate.cs b/WebServices/TodoREST/iOS/AppDelegate.cs old mode 100755 new mode 100644 index ce7617b26d..444dbde7f4 --- a/WebServices/TodoREST/iOS/AppDelegate.cs +++ b/WebServices/TodoREST/iOS/AppDelegate.cs @@ -9,16 +9,6 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); - -#if DEBUG - System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => - { - if (certificate.Issuer.Equals("CN=localhost")) - return true; - return sslPolicyErrors == System.Net.Security.SslPolicyErrors.None; - }; -#endif - LoadApplication(new App()); return base.FinishedLaunching(app, options); } diff --git a/WebServices/TodoREST/iOS/HttpClientHandlerService.cs b/WebServices/TodoREST/iOS/HttpClientHandlerService.cs new file mode 100644 index 0000000000..8dafc59fe3 --- /dev/null +++ b/WebServices/TodoREST/iOS/HttpClientHandlerService.cs @@ -0,0 +1,22 @@ +using System.Net.Http; +using TodoREST.iOS; +using Xamarin.Forms; + +[assembly: Dependency(typeof(HttpClientHandlerService))] +namespace TodoREST.iOS +{ + public class HttpClientHandlerService : IHttpClientHandlerService + { + public HttpClientHandler GetInsecureHandler() + { + HttpClientHandler handler = new HttpClientHandler(); + handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => + { + if (cert.Issuer.Equals("CN=localhost")) + return true; + return errors == System.Net.Security.SslPolicyErrors.None; + }; + return handler; + } + } +} diff --git a/WebServices/TodoREST/iOS/TodoREST.iOS.csproj b/WebServices/TodoREST/iOS/TodoREST.iOS.csproj index a31286bfc6..a28209319f 100644 --- a/WebServices/TodoREST/iOS/TodoREST.iOS.csproj +++ b/WebServices/TodoREST/iOS/TodoREST.iOS.csproj @@ -1,6 +1,5 @@  - Debug iPhoneSimulator @@ -14,7 +13,6 @@ true 4dbe7b8e true - PackageReference true @@ -30,61 +28,19 @@ true true iPhone Developer - HttpClientHandler + NSUrlSessionHandler full true bin\iPhone\Release - prompt 4 - false Entitlements.plist ARM64 false iPhone Developer NSUrlSessionHandler - anycpu - false - - true - - - - - - - - - - - - - - - - - - - - - false - - - - - -1 - - - - - - false - false - Default - false - full @@ -113,6 +69,9 @@ true NSUrlSessionHandler + + + @@ -120,9 +79,6 @@ - - - {05A1AF58-41E1-4FFD-BB93-E8BA58BE5646} @@ -159,13 +115,11 @@ + - - -