public async Task IdentifyAsync(ICustomerDetails customer = null)
        {
            if (customer == null && _customerFactory == null)
            {
                throw new ArgumentNullException(
                          nameof(customer),
                          "Missing both customer and customer factory, so can not determine who to track");
            }

            customer = customer ?? _customerFactory.GetCustomerDetails();

            // do not transmit events if we do not have a customer id
            if (customer?.Id == null)
            {
                return;
            }

            var resource = $"{TrackEndpoint}/customers/{customer.Id}";

            await CallMethodAsync(resource, HttpMethod.Put, customer).ConfigureAwait(false);
        }
示例#2
0
        public async Task IdentifyAsync()
        {
            var id = _customerFactory.GetCustomerId();

            await CallMethodAsync(MethodCustomer, id, Method.PUT, _customerFactory.GetCustomerDetails());
        }