Skip to main content

OculusDeepLinkService

A static class in Root.Township, the global namespace.

Client on Quest: handles Meta deep links that launch the game into a server, at startup and while running. Does nothing on other platforms or in the editor.

Fields​

1 private and internal field
MemberWhat it is
private static Logger loggerLogger for the deep link flow.

Methods​

MemberWhat it is
static async void ChangesServerViaDeepLink()Joins the server from the launch details, and goes back to the main menu if that fails.
static void SimulateDeepLinkIntent()Runs the intent handler as if a deep link arrived. For testing.
static async Task<bool> TryConnectToDeepLinkServer()If the app was launched by a deep link, joins that server. Returns whether it joined.
6 private and internal methods
MemberWhat it is
private static void Initialize()Runs on load; on Quest outside the editor, hooks Startup to app start.
private static bool IsInLocalTestServer()True in local test with a joined server.
private static async Task<bool> JoinServerViaDeepLink(PlatformLaunchDetails launchDetails, int serverID)Looks up the server through the API and joins it, logging the result to Meta and showing an error on failure.
private static void OnDeepLinkIntent()Handles a new launch intent; skips if not logged in yet.
private static void Startup()Registers for Meta's launch intent change notification.
private static bool TryGetValidLaunchDetails(out PlatformLaunchDetails launchDetails, out int serverID)Reads the launch details and server ID; fails if not a deep link or already on that server.