Ejemplo n.º 1
0
 public PublishToTagOperator(PublishToTagOperatorModel model, IAWSMobilePushNotificationConfigProvider provider) : base(model, provider)
 {
     this.model                  = model;
     this.tagOperator            = new TagOperator(provider);
     this.subscriberTableService = new DynamoSubscribersTableOperator(provider);
     this.unRegisterService      = new UnRegisterOperator(provider);
 }
        /// <summary>
        /// Validate and make the request
        /// </summary>
        public async Task <UnRegisterResult> SendAsync()
        {
            try
            {
                Validate();
                UnRegisterOperator unRegisterService = new UnRegisterOperator(base.Provider);
                UnRegisterResult   result            = await unRegisterService.UnRegisterUserAsync(this.UserId);

                return(result);
            }
            catch (AWSMobilePushNotificationServiceException ex)
            {
                return(new UnRegisterFailedResult(ex));
            }
            catch (Exception ex)
            {
                if (Provider.CatchAllExceptions)
                {
                    return(new UnRegisterFailedResult(ex.Message));
                }
                else
                {
                    throw ex;
                }
            }
        }