JavaScriptEnvironmentProtocol

public protocol JavaScriptEnvironmentProtocol : Sendable

Protocol for building the Airship JavaScript environment injected into web views.

  • Adds a string getter to the Airship JavaScript environment.

    Declaration

    Swift

    func add(_ getter: String, string: String?)

    Parameters

    getter

    The getter’s name.

    string

    The getter’s value.

  • Adds a number getter to the Airship JavaScript environment.

    Declaration

    Swift

    func add(_ getter: String, number: Double?)

    Parameters

    getter

    The getter’s name.

    number

    The getter’s value.

  • Adds a dictionary getter to the Airship JavaScript environment.

    Declaration

    Swift

    func add(_ getter: String, dictionary: [AnyHashable : Any]?)

    Parameters

    getter

    The getter’s name.

    dictionary

    The getter’s value.

  • build() Asynchronous

    Builds the script that can be injected into a web view.

    Declaration

    Swift

    func build() async -> String

    Return Value

    The script.