nettoyage

vnext
Paul Schneider 8 years ago
parent 94ad1f3fca
commit d6f72ba20f
6 changed files with 10 additions and 114 deletions

@ -3,6 +3,8 @@
/* Set some basic padding to keep content from hitting the edges */ /* Set some basic padding to keep content from hitting the edges */
body { body {
/* background-color: #04264f;
color:#000;*/
background-color: #210912; background-color: #210912;
color:#999; color:#999;
} }

File diff suppressed because one or more lines are too long

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

@ -1,69 +0,0 @@
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
namespace MessageSender
{
public class Program
{
public const string API_KEY = "AIzaSyDwPlu2ky9AoPwDvThoXxJwqiPq-Tc8p8k";
public const string MESSAGE = "Hello, Xamarin!";
static void Main(string[] args)
{
var reg_id= "eRSVBXTxiyk:APA91bE1NRs6LWBq9O3ACBV5g4B8D2ANwS9UjpPkwYFYWtv6NeTuSzBb6ZBhOFx_gbh9AbSgZ7uHETOPp26ahhJY74i55f7gULgaQR7-MV5CeaBYANfKcVgqQ5GTsb2zMCS_2MIUVy3Q";
var jGcmData = new JObject();
var jNotification = new JObject();
jNotification.Add("body","a body");
jNotification.Add("title",MESSAGE);
jNotification.Add("icon","icon");
jGcmData.Add("to",reg_id);
jGcmData.Add("notification",jNotification);
/* "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
"notification" : {
"body" : "great match!",
"title" : "Portugal vs. Denmark",
"icon" : "myicon"
}
var jData = new JObject();
jData.Add("message", MESSAGE);
jGcmData.Add("to", "/topics/global");
jGcmData.Add("data", jData);
*/
var url = new Uri("https://gcm-http.googleapis.com/gcm/send");
try
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.TryAddWithoutValidation(
"Authorization", "key=" + API_KEY);
Task.WaitAll(client.PostAsync(url,
new StringContent(jGcmData.ToString(), Encoding.UTF8, "application/json"))
.ContinueWith(response =>
{
Task.Run ( async () => {
var content = await response.Result.Content.ReadAsStringAsync();
Console.WriteLine(content);
});
Console.WriteLine(">Message sent: check the client device notification tray.");
}));
}
}
catch (Exception e)
{
Console.WriteLine("Unable to send GCM message:");
Console.Error.WriteLine(e.StackTrace);
}
}
}
}

@ -1,28 +0,0 @@
{
"version": "1.0.0-*",
"description": "ConsoleApplication Console Application",
"authors": [
""
],
"tags": [
""
],
"projectUrl": "",
"licenseUrl": "",
"compilationOptions": {
"emitEntryPoint": true
},
"tooling": {
"defaultNamespace": "ConsoleApplication"
},
"dependencies": {
"Newtonsoft.Json": "9.0.1",
"System.Net.Http": "4.1.0"
},
"commands": {
"ConsoleApplication": "ConsoleApplication"
},
"frameworks": {
"dnx451": {}
}
}

@ -76,19 +76,19 @@ namespace testOauthClient
LoginPath = new PathString("/signin"), LoginPath = new PathString("/signin"),
LogoutPath = new PathString("/signout") LogoutPath = new PathString("/signout")
}); });
var host = "http://dev.pschneider.fr";
app.UseOAuthAuthentication( app.UseOAuthAuthentication(
options => options =>
{ {
options.AuthenticationScheme = "Yavsc"; options.AuthenticationScheme = "Yavsc";
options.AuthorizationEndpoint = "http://dev.pschneider.fr/authorize"; options.AuthorizationEndpoint = $"{host}/authorize";
options.TokenEndpoint = "http://dev.pschneider.fr/token"; options.TokenEndpoint = $"{host}/dev.pschneider.fr/token";
options.CallbackPath = new PathString("/signin-yavsc"); options.CallbackPath = new PathString("/signin-yavsc");
options.ClientId = "21d8bd1b-4aed-4fcb-9ed9-00b43f6a8169"; options.ClientId = "[Your client Id]";
options.ClientSecret = "blih"; options.ClientSecret = "blih";
options.Scope.Add("profile"); options.Scope.Add("profile");
options.SaveTokensAsClaims = true; options.SaveTokensAsClaims = true;
options.UserInformationEndpoint = "http://dev.pschneider.fr/api/me"; options.UserInformationEndpoint = $"{host}/api/me";
options.Events = new OAuthEvents options.Events = new OAuthEvents
{ {
OnCreatingTicket = async context => OnCreatingTicket = async context =>

Loading…