Beispiel #1
0
        private async Task FetchLocationAsync(ITargetService targetService)
        {
            var request = new TargetDeliveryRequest.Builder()
                          .SetDecisioningMethod(DecisioningMethod.ServerSide)
                          .SetContext(new Context(ChannelType.Web))
                          .Build();

            var response = await targetService.ExecuteRequestAsync(request);

            var tntId = response.Response?.Id?.TntId;

            if (response.Status < HttpStatusCode.OK || response.Status >= HttpStatusCode.Ambiguous ||
                tntId == null)
            {
                return;
            }

            Interlocked.Exchange(ref this.locationHint, CookieUtils.LocationHintFromTntId(tntId));
        }