コード例 #1
0
        protected override async Task Send(NotificationMessage model, PushbulletNotificationSettings settings)
        {
            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, model.Subject, model.Message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
コード例 #2
0
        private async Task Push(PushbulletNotificationSettings settings, string message, string title)
        {
            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, title, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
コード例 #3
0
        private async Task PushTestAsync(NotificationModel model, PushbulletNotificationSettings settings)
        {
            var message   = "This is just a test! Success!";
            var pushTitle = "Plex Requests: Test Message!";

            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, pushTitle, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
コード例 #4
0
        private async Task PushIssueAsync(NotificationModel model, PushbulletNotificationSettings settings)
        {
            var message   = $"A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";
            var pushTitle = $"Plex Requests: A new issue has been reported for {model.Title}";

            try
            {
                var result = await PushbulletApi.PushAsync(settings.AccessToken, pushTitle, message, settings.DeviceIdentifier);

                if (result != null)
                {
                    Log.Error("Pushbullet api returned a null value, the notification did not get pushed");
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }