Esempio n. 1
0
        public static void GetHeaders(WindowsNotification notif, out string notificationType, out string contentType, out string tag)
        {
            notificationType = "wns/toast";
            contentType      = "text/xml";
            tag = "";

            if (!string.IsNullOrEmpty(notif.Badge))
            {
                notificationType = "wns/badge";
            }

            if (string.IsNullOrEmpty(notif.Title) && string.IsNullOrEmpty(notif.Message) && !string.IsNullOrEmpty(notif.Action))
            {
                notificationType = "wns/raw";
                contentType      = "application/octet-stream";
            }

            if (string.IsNullOrEmpty(notif.Action) && notif.Parameters.Count == 1 && notif.Parameters.Names[0] == "tile")
            {
                notificationType = "wns/tile";
            }

            if (currentInstance == null)
            {
                currentInstance = new Win8Notifications();
            }
        }
Esempio n. 2
0
        private int SendWin8(string applicationId, string deviceToken, string alert, string action, NotificationParameters props)
        {
            if (props == null)
            {
                props = new NotificationParameters();
            }

            ConfigurationProps securityInfo = Certificates.Instance.PropertiesFor(applicationId);

            return(Win8Notifications.Send(securityInfo.WNSClientSecret, securityInfo.WNSPackageSecurityIdentifier, deviceToken, action, alert, props, out m_customError) ? 0 : 3);
        }