Contents

nw_parameters_set_attribution(_:_:)

Sets a flag that indicates whether the network request originates from the developer or the user.

Declaration

func nw_parameters_set_attribution(_ parameters: nw_parameters_t, _ attribution: nw_parameters_attribution_t)

Parameters

  • parameters:

    The network parameters to update.

  • attribution:

    An indication of whether the network request comes from the developer or from the user.

Mentioned in

Discussion

If you don’t set this flag, the system assumes a value of nw_parameters_attribution_t.developer. Use this default value for any network request that your app makes that isn’t explicitly from the user. This includes requests that you make to your own server, even when you load user data. It also includes links that the user selects, but that you modify in any way — including by adding HTTP headers — before loading the content.

Set this value to nw_parameters_attribution_t.user only for requests that the user explicitly makes, like when the user enters a URL or taps or clicks a URL that they can read, and only if your app loads and displays the data without altering the request.

See Also

Traffic Attribution