Mise à niveau de la plateforme .Net :
Mono 4.2.1 Asp.Net 4.0.30319.17020 * Web.config: l'entité nbsp n'est plus supportée * Yavsc.csproj: mise à niveau de Newtownsoft.Json * packages.config: mise à jour des paquets nuget * GoogleHelpers.cs: ça marchait avant, mais c'etait mal écrit et a cassé à la mise à niveau de la plateforme. * SimpleJsonPostMethod.cs: using Newtonsoft.Json
This commit is contained in:
parent
3b33be013c
commit
d40679cdf4
7 changed files with 56 additions and 40 deletions
|
|
@ -145,14 +145,14 @@ namespace Yavsc.Model.Google.Api
|
|||
public static MessageWithPayloadResponse NotifyEvent (NominativeEventPub evpub)
|
||||
{
|
||||
using (var r =
|
||||
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse> (
|
||||
new SimpleJsonPostMethod<MessageWithPayload<NominativeEventPub>,MessageWithPayloadResponse> (
|
||||
"https://gcm-http.googleapis.com/gcm/send")) {
|
||||
r.SetCredential ("key="+ConfigurationManager.AppSettings ["GOOGLE_API_KEY"]);
|
||||
var userprofile = ProfileBase.Create (evpub.PerformerName);
|
||||
var regid = userprofile.GetPropertyValue ("gregid") as string;
|
||||
if (regid == null)
|
||||
throw new NotImplementedException ("Notification via e-mail");
|
||||
var msg = new MessageWithPayload<YaEvent> () {
|
||||
var msg = new MessageWithPayload<NominativeEventPub> () {
|
||||
notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "icon" },
|
||||
data = evpub, registration_ids = new string[] { regid } };
|
||||
return r.Invoke (msg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue