public void Send(CompletableNotification notification)
        {
            XNamespace ns  = GCM_MSG_NAMESPACE;
            var        gcm = new XElement(ns + "gcm", notification.Notification.ToJson());
            var        msg = new XElement("message", new XAttribute("id", string.Empty), gcm);

            Log.Debug("GCM-XMPP: Sending: " + msg);

            try {
                WriteElement(msg);

                notifications.Add(notification.Notification.MessageId, notification);
            } catch (Exception ex) {
                notification.CompleteFailed(ex);
            }
        }
Exemplo n.º 2
0
        public void Send (CompletableNotification notification)
        {

            XNamespace ns = GCM_MSG_NAMESPACE;
            var gcm = new XElement (ns + "gcm", notification.Notification.ToJson ());
            var msg = new XElement ("message", new XAttribute ("id", string.Empty), gcm);

            Log.Debug ("GCM-XMPP: Sending: " + msg);

            try {
                WriteElement (msg);

                notifications.Add (notification.Notification.MessageId, notification);
            } catch (Exception ex) {
                notification.CompleteFailed (ex);
            }
        }