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
getterThe getter’s name.
stringThe getter’s value.
-
Adds a number getter to the Airship JavaScript environment.
Declaration
Swift
func add(_ getter: String, number: Double?)Parameters
getterThe getter’s name.
numberThe getter’s value.
-
Adds a dictionary getter to the Airship JavaScript environment.
Declaration
Swift
func add(_ getter: String, dictionary: [AnyHashable : Any]?)Parameters
getterThe getter’s name.
dictionaryThe getter’s value.
-
build()AsynchronousBuilds the script that can be injected into a web view.
Declaration
Swift
func build() async -> StringReturn Value
The script.
View on GitHub