ExtensionAgentDelegate

public protocol ExtensionAgentDelegate : AnyObject

The ExtensionAgentDelegate protocol defines methods that action when ExtensionAgent receives a directive.

The methods of this protocol are all mandatory.

  • Provide a context of ExtensionAgent. This function should return as soon as possible to reduce request delay.

    This context is used by the backend proxy server.

    For more information, see Backend proxy API Reference.

    Declaration

    Swift

    func extensionAgentRequestContext() -> [String : AnyHashable]?
  • Tells the delegate that ExtensionAgent received action directive

    When received any data, must call completion block to send an event.

    Declaration

    Swift

    func extensionAgentDidReceiveAction(data: [String : AnyHashable], playServiceId: String, header: Downstream.Header, completion: @escaping (Bool) -> Void)

    Parameters

    data

    The message decoded from json to dictionary received by action directive.

    playServiceId

    The unique identifier to specify play service.

    header

    The header of the originally handled directive.

    completion

    A block to call when you are finished performing the action.