Ansight.Pairing
0.1.0-pre3
dotnet add package Ansight.Pairing --version 0.1.0-pre3
NuGet\Install-Package Ansight.Pairing -Version 0.1.0-pre3
<PackageReference Include="Ansight.Pairing" Version="0.1.0-pre3" />
<PackageVersion Include="Ansight.Pairing" Version="0.1.0-pre3" />
<PackageReference Include="Ansight.Pairing" />
paket add Ansight.Pairing --version 0.1.0-pre3
#r "nuget: Ansight.Pairing, 0.1.0-pre3"
#:package Ansight.Pairing@0.1.0-pre3
#addin nuget:?package=Ansight.Pairing&version=0.1.0-pre3&prerelease
#tool nuget:?package=Ansight.Pairing&version=0.1.0-pre3&prerelease
Ansight.Pairing
Ansight.Pairing adds package-owned native pairing acquisition to Ansight.
It provides:
- native QR scanning for
HostConnectionRequest.QrCode(...) - Android scanner acquisition via the current
Activityand native Apple modal presentation - a default
IHostConnectionConfigReaderwired into the existing runtime-owned host connection flow
Developer pairing is generated by the base Ansight package. Enable AnsightDeveloperPairingEnabled in the app project, then configure WithBundledHostConnection(...); Ansight.Pairing only adds the native QR acquisition path used by explicit overrides.
Usage
using Ansight;
#if ANDROID
using Microsoft.Maui.ApplicationModel;
#endif
var optionsBuilder = Options.CreateBuilder()
.WithBundledHostConnection(typeof(AppBootstrap).Assembly);
#if ANDROID
optionsBuilder = optionsBuilder.WithPlatformPairing(() => Platform.CurrentActivity);
#else
optionsBuilder = optionsBuilder.WithPlatformPairing();
#endif
var options = optionsBuilder.Build();
Runtime.InitializeAndActivate(options);
On Android, Ansight.Pairing requires the app to provide the current Activity so the package can launch the native scanner UI.
Once enabled, the app can keep using the existing host connection requests:
await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.Auto());
await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.QrCode());
await Runtime.HostConnection.ConnectAsync(HostConnectionRequest.PayloadText(payload));
Auto() still follows the normal Ansight default order: embedded developer pairing, cached session, saved config, then plain bundled config. Explicit QR and payload requests always override the current connection attempt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-android35.0 is compatible. net9.0-ios18.0 is compatible. net9.0-maccatalyst18.0 is compatible. net10.0-android was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. |
-
net9.0-android35.0
- Ansight (>= 0.1.0-pre3)
- Xamarin.GooglePlayServices.Code.Scanner (>= 116.1.0.4)
-
net9.0-ios18.0
- Ansight (>= 0.1.0-pre3)
-
net9.0-maccatalyst18.0
- Ansight (>= 0.1.0-pre3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-pre3 | 37 | 4/21/2026 |