Пример #1
0
        private static void TestPushbullet()
        {
            var config = new Dictionary<string, string>()
            {
                //{ "pb_access_token", "" },
            };

            var receps = new IHaleAlertRecipient[]
            {
                new HaleAlertPushbulletRecipient()
                {
                    Id = Guid.NewGuid(),
                    Name = "test",
                    Target = "*****@*****.**",
                    TargetType = PushbulletPushTarget.Email,
                    AccessToken = "o.A3d9D70dw7B54yDSs21paIOvCQr3tjEO"
                }
            };

            try
            {
                _("Creating Pushbullet Hale Alert instance...");
                var pbAlert = new HaleAlertPushbullet();

                _(" - Name: {0}, Version: {1}, Target API: {2}", pbAlert.Name,
                    pbAlert.Version, pbAlert.TargetApi);

                _("Initializing...");
                pbAlert.Initialize(config);

                _("Init response:\n" + pbAlert.InitResponse);

                _("Sending test push...");
                pbAlert.Send("Test message", "piksel-embla.HaleAlertTest", receps);

                _("Done!");
            }
            catch (Exception x)
            {
                _("Error: " + x.Message + (x.InnerException != null ? "; " + x.InnerException.Message : ""));
            }
        }
Пример #2
0
 public void Send(string message, string source, IHaleAlertRecipient[] recipients)
 {
 }