diff --git a/BookAStar.sln b/BookAStar.sln index cf37a60d..183b2925 100644 --- a/BookAStar.sln +++ b/BookAStar.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookAStar.Droid", "BookAStar\BookAStar.Droid\BookAStar.Droid.csproj", "{2A8C2BD7-B1B6-4D74-A3FC-3F5DB3BE325E}" EndProject diff --git a/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs b/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs index 7b200659..4cc139e4 100644 --- a/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs +++ b/BookAStar/BookAStar.Droid/Helpers/SimpleJsonPostMethod.cs @@ -48,7 +48,7 @@ namespace Yavsc.Helpers request.SendChunked = true; request.TransferEncoding = "UTF-8"; if (authorizationHeader!=null) - request.Headers.Add($"Authorization: Bearer {authorizationHeader}"); + request.Headers.Add($"Authorization: {authorizationHeader}"); } public static string BasePath { get; private set; } = "http://dev.pschneider.fr/api/"; diff --git a/BookAStar/BookAStar.Droid/MainActivity.cs b/BookAStar/BookAStar.Droid/MainActivity.cs index 834ee3b6..cf78b0b6 100644 --- a/BookAStar/BookAStar.Droid/MainActivity.cs +++ b/BookAStar/BookAStar.Droid/MainActivity.cs @@ -293,7 +293,8 @@ namespace BookAStar.Droid public TAnswer InvokeApi(string method, object arg) { using (var m = - new SimpleJsonPostMethod(method, + new SimpleJsonPostMethod( + method, "Bearer "+ MainSettings.CurrentUser.YavscTokens.AccessToken )) { @@ -304,9 +305,10 @@ namespace BookAStar.Droid public object InvokeApi(string method, object arg) { using (var m = - new SimpleJsonPostMethod(method, + new SimpleJsonPostMethod( + method, "Bearer " + MainSettings.CurrentUser.YavscTokens.AccessToken - )) + )) { return m.InvokeJson(arg); } diff --git a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml index a0c47dad..659bb9cf 100644 --- a/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml +++ b/BookAStar/BookAStar.Droid/Properties/AndroidManifest.xml @@ -29,13 +29,14 @@ - - - + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar.Droid/Services/GcmRegistrationIntentService.cs b/BookAStar/BookAStar.Droid/Services/GcmRegistrationIntentService.cs index ac849504..9ede457f 100644 --- a/BookAStar/BookAStar.Droid/Services/GcmRegistrationIntentService.cs +++ b/BookAStar/BookAStar.Droid/Services/GcmRegistrationIntentService.cs @@ -44,9 +44,23 @@ namespace BookAStar.Droid Log.Info ("RegistrationIntentService", "Calling InstanceID.GetToken"); lock (locker) { - - var instanceID = InstanceID.GetInstance (this); - var senderid = MainSettings.GoogleSenderId; + + var instanceID = InstanceID.GetInstance(this); + +#if DEBUG + try + { + instanceID.DeleteInstanceID(); + + } + catch(Exception ex) + { + Debug.WaitForDebugger(); + Log.Debug("bas.GCM", ex.StackTrace.ToString()); + } +#endif + + var senderid = MainSettings.GoogleSenderId; var token = instanceID.GetToken ( senderid, GoogleCloudMessaging.InstanceIdScope, null); diff --git a/BookAStar/BookAStar.Droid/Services/MyGcmIntentService.cs b/BookAStar/BookAStar.Droid/Services/MyGcmIntentService.cs index aa2007fd..b6ed58f1 100644 --- a/BookAStar/BookAStar.Droid/Services/MyGcmIntentService.cs +++ b/BookAStar/BookAStar.Droid/Services/MyGcmIntentService.cs @@ -99,7 +99,7 @@ namespace BookAStar.Droid void SubscribeGCM () { Context context = this.ApplicationContext; - string senders = "325408689282"; + string senders = MainSettings.GoogleSenderId; // Resources.GetString(GoogleSenderId); Intent intent = new Intent ("com.google.android.c2dm.intent.REGISTER"); intent.SetPackage ("com.google.android.gsf"); diff --git a/BookAStar/BookAStar.Droid/app.config b/BookAStar/BookAStar.Droid/app.config index de5386a4..8460dd43 100644 --- a/BookAStar/BookAStar.Droid/app.config +++ b/BookAStar/BookAStar.Droid/app.config @@ -4,7 +4,7 @@ - + diff --git a/BookAStar/BookAStar.iOS/BookAStar.iOS.csproj b/BookAStar/BookAStar.iOS/BookAStar.iOS.csproj index b57c0800..1c69864b 100644 --- a/BookAStar/BookAStar.iOS/BookAStar.iOS.csproj +++ b/BookAStar/BookAStar.iOS/BookAStar.iOS.csproj @@ -90,6 +90,7 @@ + @@ -151,4 +152,4 @@ - + \ No newline at end of file diff --git a/BookAStar/BookAStar.iOS/app.config b/BookAStar/BookAStar.iOS/app.config new file mode 100644 index 00000000..8460dd43 --- /dev/null +++ b/BookAStar/BookAStar.iOS/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/BookAStar/BookAStar/App.xaml.cs b/BookAStar/BookAStar/App.xaml.cs index 412de277..adb41003 100644 --- a/BookAStar/BookAStar/App.xaml.cs +++ b/BookAStar/BookAStar/App.xaml.cs @@ -86,7 +86,8 @@ namespace BookAStar public async Task PostDeviceInfo() { var res = PlateformSpecificInstance.InvokeApi( - "gcm/register", PlateformSpecificInstance.GetDeviceInfo()); + "gcm/register", + PlateformSpecificInstance.GetDeviceInfo()); } } diff --git a/BookAStar/BookAStar/Helpers/MainSettings.cs b/BookAStar/BookAStar/Helpers/MainSettings.cs index 33bd6581..5b69b109 100644 --- a/BookAStar/BookAStar/Helpers/MainSettings.cs +++ b/BookAStar/BookAStar/Helpers/MainSettings.cs @@ -58,7 +58,7 @@ namespace BookAStar }; private static readonly Dictionary environ = new Dictionary(); - public static readonly string YavscApiUrl = "dev.pschneider.fr"; + public static readonly string YavscApiUrl = "http://dev.pschneider.fr/api"; #endregion diff --git a/Yavsc.Api/project.lock.json b/Yavsc.Api/project.lock.json index a111b505..f3013ca9 100644 --- a/Yavsc.Api/project.lock.json +++ b/Yavsc.Api/project.lock.json @@ -120,6 +120,18 @@ "lib/net45/System.Interactive.Async.dll": {} } }, + "Json.NET.Web/1.0.49": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "8.0.3" + }, + "compile": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + }, + "runtime": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + } + }, "Microsoft.AspNet.Authentication/1.0.0-rc1-final": { "type": "package", "dependencies": { @@ -754,7 +766,11 @@ }, "Yavsc.Client/1.0.0": { "type": "project", - "framework": ".NETPortable,Version=v4.5,Profile=Profile111" + "framework": ".NETPortable,Version=v4.5,Profile=Profile111", + "dependencies": { + "Json.NET.Web": "1.0.49", + "Newtonsoft.Json": "9.0.1" + } } }, ".NETFramework,Version=v4.5.1/win7-x86": { @@ -875,6 +891,18 @@ "lib/net45/System.Interactive.Async.dll": {} } }, + "Json.NET.Web/1.0.49": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "8.0.3" + }, + "compile": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + }, + "runtime": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + } + }, "Microsoft.AspNet.Authentication/1.0.0-rc1-final": { "type": "package", "dependencies": { @@ -1509,7 +1537,11 @@ }, "Yavsc.Client/1.0.0": { "type": "project", - "framework": ".NETPortable,Version=v4.5,Profile=Profile111" + "framework": ".NETPortable,Version=v4.5,Profile=Profile111", + "dependencies": { + "Json.NET.Web": "1.0.49", + "Newtonsoft.Json": "9.0.1" + } } }, ".NETFramework,Version=v4.5.1/win7-x64": { @@ -1630,6 +1662,18 @@ "lib/net45/System.Interactive.Async.dll": {} } }, + "Json.NET.Web/1.0.49": { + "type": "package", + "dependencies": { + "Newtonsoft.Json": "8.0.3" + }, + "compile": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + }, + "runtime": { + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll": {} + } + }, "Microsoft.AspNet.Authentication/1.0.0-rc1-final": { "type": "package", "dependencies": { @@ -2264,7 +2308,11 @@ }, "Yavsc.Client/1.0.0": { "type": "project", - "framework": ".NETPortable,Version=v4.5,Profile=Profile111" + "framework": ".NETPortable,Version=v4.5,Profile=Profile111", + "dependencies": { + "Json.NET.Web": "1.0.49", + "Newtonsoft.Json": "9.0.1" + } } } }, @@ -2383,6 +2431,16 @@ "lib/portable-windows8+net45+wp8/System.Interactive.Async.XML" ] }, + "Json.NET.Web/1.0.49": { + "type": "package", + "sha512": "1lhQBN6Oi5IEf2BIhBgqWH3r9uBUitvsoQi0QlC+8IkFYyHq+076OorXbcTxmcXgSsmc66LyoUpqG62BnLOWgg==", + "files": [ + "Json.NET.Web.1.0.49.nupkg", + "Json.NET.Web.1.0.49.nupkg.sha512", + "Json.NET.Web.nuspec", + "lib/portable45-net45+win8+wpa81/Json.NET.Web.dll" + ] + }, "Microsoft.AspNet.Authentication/1.0.0-rc1-final": { "type": "package", "serviceable": true, diff --git a/Yavsc.Client/Yavsc.Client.csproj b/Yavsc.Client/Yavsc.Client.csproj index b21ce6f0..d7771e2d 100644 --- a/Yavsc.Client/Yavsc.Client.csproj +++ b/Yavsc.Client/Yavsc.Client.csproj @@ -48,6 +48,7 @@ + Designer @@ -57,8 +58,8 @@ ..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll True - - ..\packages\Newtonsoft.Json.8.0.3\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll True diff --git a/Yavsc.Client/app.config b/Yavsc.Client/app.config new file mode 100644 index 00000000..8460dd43 --- /dev/null +++ b/Yavsc.Client/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Yavsc.Client/packages.config b/Yavsc.Client/packages.config index dc205314..3e864e39 100644 --- a/Yavsc.Client/packages.config +++ b/Yavsc.Client/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/wrap/Yavsc.Client/project.json b/wrap/Yavsc.Client/project.json index 451528f0..cbd22f76 100644 --- a/wrap/Yavsc.Client/project.json +++ b/wrap/Yavsc.Client/project.json @@ -6,6 +6,10 @@ "bin": { "assembly": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.dll", "pdb": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.pdb" + }, + "dependencies": { + "Json.NET.Web": "1.0.49", + "Newtonsoft.Json": "9.0.1" } } }