GCM Ok[Debug]
This commit is contained in:
@ -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
|
||||
|
@ -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/";
|
||||
|
@ -293,7 +293,8 @@ namespace BookAStar.Droid
|
||||
public TAnswer InvokeApi<TAnswer>(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);
|
||||
}
|
||||
|
@ -29,13 +29,14 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<permission android:name="com.xamarin.mobilecrm.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
|
||||
<uses-permission android:name="com.xamarin.mobilecrm.permission.MAPS_RECEIVE" />
|
||||
<permission android:name="fr.pschneider.bas.permission.C2D_MESSAGE" />
|
||||
<permission android:name="fr.pschneider.bas.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
|
||||
<uses-permission android:name="fr.pschneider.bas.permission.MAPS_RECEIVE" />
|
||||
<permission android:name="fr.pschneider.bas.permission.C2D_MESSAGE" android:protectionLevel="signature" />
|
||||
<uses-permission android:name="fr.pschneider.bas.permission.C2D_MESSAGE" />
|
||||
<uses-permission android:name="com.google.android.c2dm.intent.RECEIVE" />
|
||||
<uses-permission android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||
<uses-permission android:name="com.google.android.c2dm.intent.RETRY" />
|
||||
<uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
</manifest>
|
@ -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);
|
||||
|
||||
|
@ -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");
|
||||
|
@ -4,7 +4,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
@ -90,6 +90,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="app.config" />
|
||||
<None Include="Entitlements.plist" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
@ -151,4 +152,4 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
</Project>
|
11
BookAStar/BookAStar.iOS/app.config
Normal file
11
BookAStar/BookAStar.iOS/app.config
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -86,7 +86,8 @@ namespace BookAStar
|
||||
public async Task PostDeviceInfo()
|
||||
{
|
||||
var res = PlateformSpecificInstance.InvokeApi(
|
||||
"gcm/register", PlateformSpecificInstance.GetDeviceInfo());
|
||||
"gcm/register",
|
||||
PlateformSpecificInstance.GetDeviceInfo());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace BookAStar
|
||||
};
|
||||
private static readonly Dictionary<string, double> environ = new Dictionary<string, double>();
|
||||
|
||||
public static readonly string YavscApiUrl = "dev.pschneider.fr";
|
||||
public static readonly string YavscApiUrl = "http://dev.pschneider.fr/api";
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -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,
|
||||
|
@ -48,6 +48,7 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@ -57,8 +58,8 @@
|
||||
<HintPath>..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
11
Yavsc.Client/app.config
Normal file
11
Yavsc.Client/app.config
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Json.NET.Web" version="1.0.49" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="portable45-net45+win8+wpa81" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="portable45-net45+win8+wpa81" />
|
||||
</packages>
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user