Exemplo n.º 1
0
        public static ResponseData BuildResponseData(ActivityPackage activityPackage)
        {
            ActivityKind activityKind = activityPackage.ActivityKind;
            ResponseData responseData;

            switch (activityKind)
            {
            case ActivityKind.Session:
                responseData = new SessionResponseData();
                break;

            case ActivityKind.Attribution:
                responseData = new AttributionResponseData();
                break;

            case ActivityKind.Event:
                responseData = new EventResponseData(activityPackage);
                break;

            case ActivityKind.Click:
                responseData = new SdkClickResponseData();
                break;

            default:
                responseData = new UnknowResponseData();
                break;
            }

            responseData.ActivityKind = activityKind;

            return(responseData);
        }
Exemplo n.º 2
0
        private void CheckAttributionResponseI(AttributionResponseData attributionResponseData)
        {
            CheckAttributionI(attributionResponseData);

            CheckDeeplink(attributionResponseData);

            _activityHandler.LaunchAttributionResponseTasks(attributionResponseData);
        }
Exemplo n.º 3
0
        private void CheckDeeplink(AttributionResponseData attributionResponseData)
        {
            if (attributionResponseData.Attribution?.Json == null)
            {
                return;
            }

            var deeplink = Util.GetDictionaryString(attributionResponseData.Attribution.Json, "deeplink");

            if (deeplink == null)
            {
                return;
            }

            if (!Uri.IsWellFormedUriString(deeplink, UriKind.Absolute))
            {
                _logger.Error("Malformed deffered deeplink '{0}'", deeplink);
                return;
            }

            attributionResponseData.Deeplink = new Uri(deeplink);
        }