CPMCD.MobileSDK 1.0.0

dotnet add package CPMCD.MobileSDK --version 1.0.0
                    
NuGet\Install-Package CPMCD.MobileSDK -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CPMCD.MobileSDK" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CPMCD.MobileSDK" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CPMCD.MobileSDK" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CPMCD.MobileSDK --version 1.0.0
                    
#r "nuget: CPMCD.MobileSDK, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CPMCD.MobileSDK@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CPMCD.MobileSDK&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CPMCD.MobileSDK&version=1.0.0
                    
Install as a Cake Tool

CPMCD.MobileSDK

Reusable .NET MAUI SDK — auth, networking, QR/RFID scanning, offline sync, file upload, logging.

Setup (MauiProgram.cs)

var builder = MauiApp.CreateBuilder();

builder.AddFaisalSDK(options =>
{
    options.BaseUrl = "https://your-api.example.com/";
    options.Timeout = TimeSpan.FromSeconds(30);
    options.EnableLogging = true;
    options.AutoSyncOnConnectivityRestored = true;
});

var app = builder.Build();

// Activate the connectivity-triggered offline sync watcher (only needed once):
app.Services.GetRequiredService<ConnectivityAutoSyncService>();

Auth

var auth = serviceProvider.GetRequiredService<IAuthServices>();
var result = await auth.LoginAsync(new LoginRequest { Username = "...", Password = "..." });
bool isLoggedIn = await auth.IsAuthenticatedAsync();

Networking

IApiClient is auth-aware automatically (bearer token attached via AuthHandler).

var api = serviceProvider.GetRequiredService<IApiClient>();
var items = await api.GetAsync<List<Item>>("api/items");

QR / Barcode scanning

Drop SdkBarcodeScannerView into any XAML page, then control the session via IQrScanService:

<sdk:SdkBarcodeScannerView xmlns:sdk="clr-namespace:CPMCD.MobileSDK.Scanning;assembly=CPMCD.MobileSDK" />
var scanner = serviceProvider.GetRequiredService<IQrScanService>();
scanner.Scanned += (_, result) => Console.WriteLine(result.Value);
await scanner.StartScanningAsync();

RFID

IRfidScanService is registered with a no-op default (logs a warning). RFID readers are vendor-specific hardware — register your vendor's driver after AddFaisalSDK(...):

builder.Services.AddSingleton<IRfidScanService, YourVendorRfidService>();

Offline sync

Queue writes that must not be lost when offline; they auto-replay when connectivity returns (if AutoSyncOnConnectivityRestored is on), or trigger manually:

var sync = serviceProvider.GetRequiredService<IOfflineSyncService>();
await sync.QueueAsync("api/audits", PendingHttpMethod.Post, auditPayload);
// later, or automatically on reconnect:
await sync.SyncNowAsync();

Read-side cache for offline screens:

var cache = serviceProvider.GetRequiredService<IOfflineCacheService>();
await cache.SetAsync("last-dealer-list", dealers);
var cached = await cache.GetAsync<List<Dealer>>("last-dealer-list");

File / image upload

var upload = serviceProvider.GetRequiredService<IFileUploadService>();
var result = await upload.UploadFileAsync("api/audits/photo", filePath,
    progress: new Progress<UploadProgress>(p => Console.WriteLine($"{p.PercentComplete:F0}%")));

Logging

var logger = serviceProvider.GetRequiredService<ISdkLogger>();
logger.Info("Something happened");

Logs go to Debug output and AppDataDirectory/sdk-logs/sdk-yyyy-MM-dd.log.

Publishing as a NuGet package

dotnet pack CPMCD.MobileSDK/CPMCD.MobileSDK.csproj -c Release
dotnet nuget push bin/Release/CPMCD.MobileSDK.1.0.0.nupkg --source <your-feed> --api-key <key>

Push CPMCD.MobileSDK.Abstractions the same way if consumers need the interfaces without the MAUI implementation (e.g. shared with a backend project).

Known gaps to close before shipping to other teams

  • No automated tests yet.
  • IRfidScanService needs a real vendor implementation per deployment (Zebra/Honeywell/etc).
  • Offline sync replays payloads as raw JSON — response bodies from queued calls aren't surfaced back to callers (fire-and-forget by design; add a completion callback if you need per-item results).
  • No retry/backoff policy on IApiClient yet (e.g. Polly) — worth adding for flaky mobile networks.
Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-ios18.0 is compatible.  net10.0-android was computed.  net10.0-ios was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 116 8/15/2026