Dev Tunnels

Wisej.NET Hybrid enables you to build cross-platform apps that run either remotely (connected to a server) or locally (offline mode). When developing or debugging remote mode apps, Dev Tunnels provide an easy way to expose your local development server to the internet. This allows you to test your app on mobile devices or remote machines.

Setting up Dev Tunnels

Configuring Hybrid Client

After enabling and starting a Dev Tunnel site, set the StartupUrl in the Hybrid Client' Startup class to match the endpoint:

using HybridLocal;
using Wisej.Hybrid.Native.Core;

namespace HybridClient
{
	public static class Startup
	{
		public static MauiApp Main()
		{
			var builder = MauiApp.CreateBuilder();
			builder
				.UseMauiApp<App>()
				.ConfigureFonts(fonts =>
				{
					fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
					fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
				})

				 .UseWisejOffline<OfflineStartup>()

				.UseWisejHybrid((config) =>
				{
					// Provide the startup URL for the Hybrid WebView.
					config.StartupUrl = "https://randomname.devtunnels.ms";
				});

			return builder.Build();
		}
	}
}

Last updated