La notification à la demande de devis,
côté sérveur. * Makefile: * Yavsc.sln: * pkg.mdproj: * Yavsc.csproj: * Presta.csproj: * TestAPI.csproj: * YavscModel.csproj: * fortune.csproj: * WebControls.csproj: * YavscClient.csproj: * SalesCatalog.csproj: * ITContentProvider.csproj: * NpgsqlMRPProviders.csproj: * NpgsqlBlogProvider.csproj: * NpgsqlContentProvider.csproj: ajout d'une configuration de debuggage pour Lua * App.master: * LocalizedText.resx: * LocalizedText.fr.resx: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: traductions * EventPub.aspx: debug sur page encore inutilisée * NominativeEventPub.cs: implémentation du nom de préstataire dans la notification nominative * Commande.cs: code plus simple * GoogleHelpers.cs: * MessageWithPayLoad.cs: fixe l'envoi de la notification GCM * MessageWithPayloadResponse.cs: fixe la réception de la notification GCM * WorkFlowManager.cs: envoyer un notification GCM + email à la demande de devis
This commit is contained in:
parent
d394c3842e
commit
5a4179d051
42 changed files with 644 additions and 334 deletions
|
|
@ -106,6 +106,8 @@ namespace Yavsc.Model.Google.Api
|
|||
using (var r =
|
||||
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,MessageWithPayloadResponse>(
|
||||
"https://gcm-http.googleapis.com/gcm/send")) {
|
||||
r.SetCredential (ConfigurationManager.AppSettings ["GOOGLE_GCM_API_KEY"]);
|
||||
|
||||
if (evpub.CircleIds != null) {
|
||||
var users = Circle.Union (evpub.CircleIds);
|
||||
var regids = new List<string> ();
|
||||
|
|
@ -127,7 +129,7 @@ namespace Yavsc.Model.Google.Api
|
|||
|
||||
var msg = new MessageWithPayload<YaEvent> () {
|
||||
notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "event" },
|
||||
data = new YaEvent[] { (YaEvent)evpub }, registration_ids = regids.ToArray() };
|
||||
data = evpub , registration_ids = regids.ToArray() };
|
||||
return r.Invoke (msg);
|
||||
|
||||
} else {
|
||||
|
|
@ -145,13 +147,14 @@ namespace Yavsc.Model.Google.Api
|
|||
using (var r =
|
||||
new SimpleJsonPostMethod<MessageWithPayload<YaEvent>,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> () {
|
||||
notification = new Notification() { title = evpub.Title, body = evpub.Description, icon = "event" },
|
||||
data = new YaEvent[] { (YaEvent)evpub }, registration_ids = new string[] { regid } };
|
||||
data = evpub, registration_ids = new string[] { regid } };
|
||||
return r.Invoke (msg);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace Yavsc.Model.Google.Api.Messaging
|
|||
/// <summary>
|
||||
/// The data.
|
||||
/// </summary>
|
||||
public T[] data ;
|
||||
public T data ;
|
||||
/// <summary>
|
||||
/// The notification.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Yavsc.Model.Google.Api.Messaging
|
|||
/// <summary>
|
||||
/// The multicast identifier.
|
||||
/// </summary>
|
||||
public int multicast_id;
|
||||
public string multicast_id;
|
||||
/// <summary>
|
||||
/// The success count.
|
||||
/// </summary>
|
||||
|
|
@ -44,7 +44,7 @@ namespace Yavsc.Model.Google.Api.Messaging
|
|||
/// <summary>
|
||||
/// The canonical identifiers... ?!?
|
||||
/// </summary>
|
||||
public int canonical_ids;
|
||||
public string canonical_ids;
|
||||
/// <summary>
|
||||
/// Detailled result.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue