GCM Ok[Debug]
This commit is contained in:
parent
6a7a78558e
commit
b2fa0b34e8
16 changed files with 126 additions and 22 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 14
|
# Visual Studio 14
|
||||||
VisualStudioVersion = 14.0.25123.0
|
VisualStudioVersion = 14.0.25420.1
|
||||||
MinimumVisualStudioVersion = 10.0.40219.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}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BookAStar.Droid", "BookAStar\BookAStar.Droid\BookAStar.Droid.csproj", "{2A8C2BD7-B1B6-4D74-A3FC-3F5DB3BE325E}"
|
||||||
EndProject
|
EndProject
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Yavsc.Helpers
|
||||||
request.SendChunked = true;
|
request.SendChunked = true;
|
||||||
request.TransferEncoding = "UTF-8";
|
request.TransferEncoding = "UTF-8";
|
||||||
if (authorizationHeader!=null)
|
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/";
|
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)
|
public TAnswer InvokeApi<TAnswer>(string method, object arg)
|
||||||
{
|
{
|
||||||
using (var m =
|
using (var m =
|
||||||
new SimpleJsonPostMethod(method,
|
new SimpleJsonPostMethod(
|
||||||
|
method, "Bearer "+
|
||||||
MainSettings.CurrentUser.YavscTokens.AccessToken
|
MainSettings.CurrentUser.YavscTokens.AccessToken
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
|
|
@ -304,7 +305,8 @@ namespace BookAStar.Droid
|
||||||
public object InvokeApi(string method, object arg)
|
public object InvokeApi(string method, object arg)
|
||||||
{
|
{
|
||||||
using (var m =
|
using (var m =
|
||||||
new SimpleJsonPostMethod(method,
|
new SimpleJsonPostMethod(
|
||||||
|
method, "Bearer " +
|
||||||
MainSettings.CurrentUser.YavscTokens.AccessToken
|
MainSettings.CurrentUser.YavscTokens.AccessToken
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,14 @@
|
||||||
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
<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_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
<permission android:name="com.xamarin.mobilecrm.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
|
<permission android:name="fr.pschneider.bas.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
|
||||||
<uses-permission android:name="com.xamarin.mobilecrm.permission.MAPS_RECEIVE" />
|
<uses-permission android:name="fr.pschneider.bas.permission.MAPS_RECEIVE" />
|
||||||
<permission android:name="fr.pschneider.bas.permission.C2D_MESSAGE" />
|
<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="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.RECEIVE" />
|
||||||
<uses-permission android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
<uses-permission android:name="com.google.android.c2dm.intent.REGISTRATION" />
|
||||||
<uses-permission android:name="com.google.android.c2dm.intent.RETRY" />
|
<uses-permission android:name="com.google.android.c2dm.intent.RETRY" />
|
||||||
<uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
|
<uses-permission android:name="android.permission.ACCOUNT_MANAGER" />
|
||||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
@ -45,8 +45,22 @@ namespace BookAStar.Droid
|
||||||
lock (locker)
|
lock (locker)
|
||||||
{
|
{
|
||||||
|
|
||||||
var instanceID = InstanceID.GetInstance (this);
|
var instanceID = InstanceID.GetInstance(this);
|
||||||
var senderid = MainSettings.GoogleSenderId;
|
|
||||||
|
#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,
|
var token = instanceID.GetToken ( senderid,
|
||||||
GoogleCloudMessaging.InstanceIdScope, null);
|
GoogleCloudMessaging.InstanceIdScope, null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ namespace BookAStar.Droid
|
||||||
void SubscribeGCM ()
|
void SubscribeGCM ()
|
||||||
{
|
{
|
||||||
Context context = this.ApplicationContext;
|
Context context = this.ApplicationContext;
|
||||||
string senders = "325408689282";
|
string senders = MainSettings.GoogleSenderId;
|
||||||
// Resources.GetString(GoogleSenderId);
|
// Resources.GetString(GoogleSenderId);
|
||||||
Intent intent = new Intent ("com.google.android.c2dm.intent.REGISTER");
|
Intent intent = new Intent ("com.google.android.c2dm.intent.REGISTER");
|
||||||
intent.SetPackage ("com.google.android.gsf");
|
intent.SetPackage ("com.google.android.gsf");
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<dependentAssembly>
|
<dependentAssembly>
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
<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>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Main.cs" />
|
<Compile Include="Main.cs" />
|
||||||
<Compile Include="AppDelegate.cs" />
|
<Compile Include="AppDelegate.cs" />
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="Entitlements.plist" />
|
<None Include="Entitlements.plist" />
|
||||||
<None Include="Info.plist" />
|
<None Include="Info.plist" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|
|
||||||
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()
|
public async Task PostDeviceInfo()
|
||||||
{
|
{
|
||||||
var res = PlateformSpecificInstance.InvokeApi(
|
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>();
|
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
|
#endregion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,18 @@
|
||||||
"lib/net45/System.Interactive.Async.dll": {}
|
"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": {
|
"Microsoft.AspNet.Authentication/1.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -754,7 +766,11 @@
|
||||||
},
|
},
|
||||||
"Yavsc.Client/1.0.0": {
|
"Yavsc.Client/1.0.0": {
|
||||||
"type": "project",
|
"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": {
|
".NETFramework,Version=v4.5.1/win7-x86": {
|
||||||
|
|
@ -875,6 +891,18 @@
|
||||||
"lib/net45/System.Interactive.Async.dll": {}
|
"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": {
|
"Microsoft.AspNet.Authentication/1.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1509,7 +1537,11 @@
|
||||||
},
|
},
|
||||||
"Yavsc.Client/1.0.0": {
|
"Yavsc.Client/1.0.0": {
|
||||||
"type": "project",
|
"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": {
|
".NETFramework,Version=v4.5.1/win7-x64": {
|
||||||
|
|
@ -1630,6 +1662,18 @@
|
||||||
"lib/net45/System.Interactive.Async.dll": {}
|
"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": {
|
"Microsoft.AspNet.Authentication/1.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -2264,7 +2308,11 @@
|
||||||
},
|
},
|
||||||
"Yavsc.Client/1.0.0": {
|
"Yavsc.Client/1.0.0": {
|
||||||
"type": "project",
|
"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"
|
"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": {
|
"Microsoft.AspNet.Authentication/1.0.0-rc1-final": {
|
||||||
"type": "package",
|
"type": "package",
|
||||||
"serviceable": true,
|
"serviceable": true,
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="packages.config">
|
<None Include="packages.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</None>
|
</None>
|
||||||
|
|
@ -57,8 +58,8 @@
|
||||||
<HintPath>..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll</HintPath>
|
<HintPath>..\packages\Json.NET.Web.1.0.49\lib\portable45-net45+win8+wpa81\Json.NET.Web.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=9.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>
|
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</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"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Json.NET.Web" version="1.0.49" targetFramework="portable45-net45+win8+wpa81" />
|
<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>
|
</packages>
|
||||||
|
|
@ -6,6 +6,10 @@
|
||||||
"bin": {
|
"bin": {
|
||||||
"assembly": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.dll",
|
"assembly": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.dll",
|
||||||
"pdb": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.pdb"
|
"pdb": "../../Yavsc.Client/obj/{configuration}/Yavsc.Client.pdb"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"Json.NET.Web": "1.0.49",
|
||||||
|
"Newtonsoft.Json": "9.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue