SurfaceHandle
public sealed class SurfaceHandleNamespace Sideload.Api
Added in 1.13.0
Handle to a mounted surface: the same call and event channel an app has, minus everything that only makes sense on a phone.
Properties
Section titled “Properties”public string Id { get; }Added in 1.13.0
The id this surface was mounted under.
Methods
Section titled “Methods”OnCall
Section titled “OnCall”public SurfaceHandle OnCall(string name, Func<string, string> handler)Added in 1.13.0
Answer s1.call(name, arg) from this surface’s page. Same rules as an app’s handler: it runs on the Unity main thread in the same frame, and returns a string.
public SurfaceHandle Emit(string name, string payload = "")Added in 1.13.0
Push an event at this surface’s page - s1.on(name, fn). Nothing happens when the surface is not mounted; the page picks the state up when it next builds.
AllowHost
Section titled “AllowHost”public SurfaceHandle AllowHost(string host)Added in 1.13.0
Let this surface’s page reach one host with fetch. The allowlist starts empty.
Unmount
Section titled “Unmount”public void Unmount()Added in 1.13.0
Take this surface down.