CPMCD.MobileSDK
1.0.0
dotnet add package CPMCD.MobileSDK --version 1.0.0
NuGet\Install-Package CPMCD.MobileSDK -Version 1.0.0
<PackageReference Include="CPMCD.MobileSDK" Version="1.0.0" />
<PackageVersion Include="CPMCD.MobileSDK" Version="1.0.0" />
<PackageReference Include="CPMCD.MobileSDK" />
paket add CPMCD.MobileSDK --version 1.0.0
#r "nuget: CPMCD.MobileSDK, 1.0.0"
#:package CPMCD.MobileSDK@1.0.0
#addin nuget:?package=CPMCD.MobileSDK&version=1.0.0
#tool nuget:?package=CPMCD.MobileSDK&version=1.0.0
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.
IRfidScanServiceneeds 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
IApiClientyet (e.g. Polly) — worth adding for flaky mobile networks.
| Product | Versions 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. |
-
net9.0-android35.0
- CPMCD.MobileSDK.Abstractions (>= 1.0.0)
- Microsoft.Extensions.Http (>= 9.0.8)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.10)
- ZXing.Net.MAUI (>= 0.4.0)
- ZXing.Net.MAUI.Controls (>= 0.4.0)
-
net9.0-ios18.0
- CPMCD.MobileSDK.Abstractions (>= 1.0.0)
- Microsoft.Extensions.Http (>= 9.0.8)
- sqlite-net-pcl (>= 1.9.172)
- SQLitePCLRaw.bundle_green (>= 2.1.10)
- ZXing.Net.MAUI (>= 0.4.0)
- ZXing.Net.MAUI.Controls (>= 0.4.0)
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 |