SensorbergSDK.BeaconAction.Validate C# (CSharp) Method

Validate() public method

Validates the received action. Requirements for each action type: - URL message: Mandatory: subject, body, URL - Visit website: Optional: subject, body. Mandatory URL - In-app: Optional: subject, body. Mandatory: URL.
public Validate ( ) : bool
return bool
        public bool Validate()
        {
            bool valid = false;

            switch (Type)
            {
                case BeaconActionType.UrlMessage:
                    if (Subject.Length > 0 && Url.Length > 0 && Body.Length > 0)
                    {
                        valid = true;
                    }

                    break;
                case BeaconActionType.VisitWebsite:
                case BeaconActionType.InApp:
                    if (Url.Length > 0)
                    {
                        valid = true;
                    }

                    break;
            }

            return valid;
        }