Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit ccd256b

Browse files
committed
Should be ready for 2.3.6 release...
1 parent 13fcd6f commit ccd256b

17 files changed

Lines changed: 51 additions & 82 deletions

CodeHub.Core/App.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
using CodeHub.Core.ViewModels.App;
33
using CodeFramework.Core.Services;
44
using Cirrious.CrossCore;
5+
using System.Net;
6+
using System.Net.Http;
7+
using ModernHttpClient;
8+
using System.Threading.Tasks;
9+
using System;
10+
using Foundation;
511

612
namespace CodeHub.Core
713
{
@@ -15,14 +21,26 @@ public class App : MvxApplication
1521
/// </summary>
1622
public override void Initialize()
1723
{
24+
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
25+
1826
//Ensure this is loaded
1927
Cirrious.MvvmCross.Plugins.Messenger.PluginLoader.Instance.EnsureLoaded();
2028

21-
var httpService = Mvx.Resolve<IHttpClientService>();
22-
GitHubSharp.Client.ClientConstructor = httpService.Create;
29+
GitHubSharp.Client.ClientConstructor = () => new HttpClient(new HttpMessageHandler());
2330

2431
// Start the app with the First View Model.
2532
this.RegisterAppStart<StartupViewModel>();
2633
}
2734
}
35+
36+
class HttpMessageHandler : NativeMessageHandler
37+
{
38+
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
39+
{
40+
if (!string.Equals(request.Method.ToString(), "get", StringComparison.OrdinalIgnoreCase))
41+
NSUrlCache.SharedCache.RemoveAllCachedResponses();
42+
return base.SendAsync(request, cancellationToken);
43+
}
44+
}
45+
2846
}

CodeHub.Core/CodeHub.Core.iOS.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@
216216
<HintPath>..\CodeHub.iOS\packages\MvvmCross.HotTuna.Plugin.Messenger.3.5.1\lib\portable-win+net45+wp8+win8+wpa81\Cirrious.MvvmCross.Plugins.Messenger.dll</HintPath>
217217
</Reference>
218218
<Reference Include="Xamarin.iOS" />
219+
<Reference Include="ModernHttpClient">
220+
<HintPath>..\packages\modernhttpclient.2.4.2\lib\Xamarin.iOS10\ModernHttpClient.dll</HintPath>
221+
</Reference>
219222
</ItemGroup>
220223
<ItemGroup />
221224
<ItemGroup>

CodeHub.Core/ViewModels/Gists/GistCreateViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private async Task Save()
9191
{
9292
var createGist = new GistCreateModel()
9393
{
94-
Description = Description,
94+
Description = Description ?? string.Empty,
9595
Public = Public,
9696
Files = Files.ToDictionary(x => x.Key, x => new GistCreateModel.File { Content = x.Value })
9797
};

CodeHub.Core/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<packages>
33
<package id="Flurry.Analytics.Portable" version="1.2.0" targetFramework="MonoTouch10" />
44
<package id="GitHubClient" version="1.0.5.0" targetFramework="MonoTouch10" />
5+
<package id="modernhttpclient" version="2.4.2" targetFramework="xamarinios10" />
56
<package id="MvvmCross.HotTuna.CrossCore" version="3.5.1" targetFramework="MonoTouch10" />
67
<package id="MvvmCross.HotTuna.MvvmCrossLibraries" version="3.5.1" targetFramework="MonoTouch10" />
78
<package id="MvvmCross.HotTuna.Plugin.Messenger" version="3.5.1" targetFramework="MonoTouch10" />

CodeHub.iOS/AppDelegate.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using CodeFramework.iOS.XCallback;
2323
using Security;
2424
using ObjCRuntime;
25+
using System.Net;
2526

2627
namespace CodeHub.iOS
2728
{

CodeHub.iOS/Bindings/UISegmentControlBinding.cs

Lines changed: 0 additions & 55 deletions
This file was deleted.

CodeHub.iOS/CodeHub.iOS.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
<DependentUpon>EnableEnterpriseViewController.cs</DependentUpon>
230230
</Compile>
231231
<None Include="packages.config" />
232-
<Compile Include="Bindings\UISegmentControlBinding.cs" />
233232
<Compile Include="Cells\IssueCellView.cs" />
234233
<Compile Include="Cells\IssueCellView.designer.cs">
235234
<DependentUpon>..\..\lib\CodeFramework\CodeFramework.iOS\Cells\IssueCellView.cs</DependentUpon>
@@ -419,6 +418,9 @@
419418
<Reference Include="Flurry.Analytics.Portable">
420419
<HintPath>..\packages\Flurry.Analytics.Portable.1.2.0\lib\XamariniOS10\Flurry.Analytics.Portable.dll</HintPath>
421420
</Reference>
421+
<Reference Include="ModernHttpClient">
422+
<HintPath>..\packages\modernhttpclient.2.4.2\lib\Xamarin.iOS10\ModernHttpClient.dll</HintPath>
423+
</Reference>
422424
</ItemGroup>
423425
<ItemGroup>
424426
<Content Include="Images\anonymous%402x.png" />

CodeHub.iOS/Services/DefaultValueService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public T Get<T>(string key)
1212
throw new Exception("Value for key '" + key + "' does not exist!");
1313

1414
if (typeof(T) == typeof(int))
15-
return (T)(object)Utilities.Defaults.IntForKey(key);
15+
return (T)(object)(int)Utilities.Defaults.IntForKey(key);
1616
if (typeof(T) == typeof(bool))
1717
return (T)(object)Utilities.Defaults.BoolForKey(key);
1818
if (typeof (T) == typeof (string))

CodeHub.iOS/Services/PushNotificationsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace CodeHub.iOS.Services
1111
{
1212
public class PushNotificationsService : IPushNotificationsService
1313
{
14-
private const string RegisterUri = "http://162.243.15.10/register";
15-
private const string DeregisterUri = "http://162.243.15.10/unregister";
14+
private const string RegisterUri = "https://push.codehub-app.com/register";
15+
private const string DeregisterUri = "https://push.codehub-app.com/unregister";
1616

1717
public async Task Register()
1818
{

CodeHub.iOS/Setup.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
using MonoTouch.Dialog;
1515
using CodeFramework.iOS.Views;
1616
using UIKit;
17-
using CodeFramework.iOS.Bindings;
1817

1918
namespace CodeHub.iOS
2019
{
@@ -61,12 +60,6 @@ protected override void FillBindingNames(IMvxBindingNameRegistry obj)
6160
obj.AddOrOverwrite(typeof(UISegmentedControl), "ValueChanged");
6261
}
6362

64-
protected override void FillTargetFactories(Cirrious.MvvmCross.Binding.Bindings.Target.Construction.IMvxTargetBindingFactoryRegistry registry)
65-
{
66-
base.FillTargetFactories(registry);
67-
registry.RegisterFactory(new Cirrious.MvvmCross.Binding.Bindings.Target.Construction.MvxCustomBindingFactory<UISegmentedControl>("ValueChanged", x => new UISegmentControlBinding(x)));
68-
}
69-
7063
/// <summary>
7164
/// Creates the app.
7265
/// </summary>

0 commit comments

Comments
 (0)