Contents

makePayload(url:ownershipToken:)

Builds an accessory setup payload with the given setup payload URL and ownership token.

Declaration

func makePayload(url setupPayloadURL: URL, ownershipToken: HMAccessoryOwnershipToken) -> HMAccessorySetupPayload?

Parameters

  • setupPayloadURL:

    The setup payload URL for the accessory. Provide this URL when HomeKit sends an add request to the app associated with your accessory. You determine the URL based on the category and name of your accessory, as given in the Accessorycategory and Accessoryname properties of the associated Hmaddaccessoryrequest instance.

  • ownershipToken:

    A token proving ownership of the accessory. Your app negotiates the token with the accessory outside of HomeKit.

Return Value

An accessory setup payload that you use to add the accessory. The method fails and returns nil if the setup payload URL is invalid.

See Also

Creating a Payload