BradyCorp.Maui.SDK
2.0.0
See the version list below for details.
dotnet add package BradyCorp.Maui.SDK --version 2.0.0
NuGet\Install-Package BradyCorp.Maui.SDK -Version 2.0.0
<PackageReference Include="BradyCorp.Maui.SDK" Version="2.0.0" />
<PackageVersion Include="BradyCorp.Maui.SDK" Version="2.0.0" />
<PackageReference Include="BradyCorp.Maui.SDK" />
paket add BradyCorp.Maui.SDK --version 2.0.0
#r "nuget: BradyCorp.Maui.SDK, 2.0.0"
#addin nuget:?package=BradyCorp.Maui.SDK&version=2.0.0
#tool nuget:?package=BradyCorp.Maui.SDK&version=2.0.0
BradyCorp.MAUI.SDK
The official MAUI wrapper for the Brady SDK allows the connection from a mobile device to Brady printer allowing the printing of labels. Allows development in C# with .NET 8 MAUI to integrate both the iOS and Android functionalities supported by the Brady SDK's.
Setup
To start, you must add the following statement to your MAUI app's .csproj file. This statement is iOS specific and its purpose is to allow Objective-C code to translate properly into C# code inside the binding. Think of this as a permission.
<PropertyGroup>
<MtouchExtraArgs>--require-pinvoke-wrappers=true</MtouchExtraArgs>
</PropertyGroup>
Next, you must add this package to both the iOS and Android native projects if you are using a MAUI application. To access the library's API, use the following using statements:
- Android: Implementation identical to the native Android SDK [here](https://sdk.bradyid.com/printer_discovery_android/)
- iOS: "using BradySdkMauiIOSWrapper"
Next, intialize a BradySdk object using the constructors:
- Android: Implementation identical to the native Android SDK [here](https://sdk.bradyid.com/printer_discovery_android/)
- iOS: "new BradySdk()"
NOTE: The Maui Binding MUST be implemented for both iOS and Android separately in both native projects. This is due to different constructors and API methods for each platform. You will need to refer to the API documentation of both SDKs at https://sdk.bradyid.com to learn the discrepanies.
NOTE: Usable templates for Android MUST be embedded in Platforms>>Android>>Resources>>raw and marked as an "AndroidResource" in the files "build properties". Usable templates for iOS can be added to Resources>>Raw and marked as "BundleResource" as the Build Action. Currently, we do not support users retrieving files from their device's file system at runtime. This is due to a data conversion issue between languages in the back-end.
For both Android and iOS, you must call any asynchronous API method from a different thread. That might look like this:
Thread connectThread = new Thread(() =>
{
//FOR IOS
bool success = BradySdk.Connect(printer);
//FOR ANDROID
printerDetails = PrinterDiscovery.ConnectToDiscoveredPrinter(context, printerName, listeners);
});
connectThread.Start();
It is also suggested to wrap any asynchronous API method in a try/catch.
Thread connectThread = new Thread(() =>
{
try {
//FOR IOS
bool success = BradySdk.Connect(printer);
//FOR ANDROID
printerDetails = PrinterDiscovery.ConnectToDiscoveredPrinter(context, printerName, listeners);
}
catch (Exception e) {
Console.WriteLine(e.Message);
}
});
connectThread.Start();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-android34.0 is compatible. net8.0-ios17.2 is compatible. net9.0-android was computed. net9.0-ios was computed. |
-
net8.0-android34.0
- Codlab.Jackson.Annotations (>= 2.8.7.1)
- Codlab.Jackson.Core (>= 2.8.7.1)
- Codlab.Jackson.Databind (>= 2.8.7.1)
- Square.OkHttp3 (>= 4.12.0.4)
- Xamarin.AndroidX.Collection (>= 1.4.0.2)
- Xamarin.AndroidX.Collection.Ktx (>= 1.4.0.1)
- Xamarin.Google.ZXing.Core (>= 3.5.2.2)
- Xamarin.GooglePlayServices.Gcm (>= 117.0.0.13)
- Xamarin.GooglePlayServices.Tasks (>= 118.0.2.6)
-
net8.0-ios17.2
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
2.0.0
- Updated minSdkVersion for Android to 26
- App's with a minSdkVersion below 26 will not be able to connect to any printer if the mobile device is below Android 8
- Updated Android SDK to 2.0.1 (refer to https://sdk.bradyid.com/release_notes_android/ for details)
- Updated iOS SDK to 2.0.0 (refer to https://sdk.bradyid.com/release_notes_android/ for details)
- Updated README with further setup instructions.
- Revamped PlatformExceptions:
- Version 2.0.0 of the Android and iOS included many added exception messages that help the user pinpoint the location of the error and a resolution.
- You may now wrap any API method in a try/catch block to catch SdkApiExceptions.
- iOS Changes:
- Changed getPrinters() to return a Dictionary with the printer name and how it was discovered.
- Fixed a bug where related parts weren't considered a match (i.e. comparing the supplies "M21-750" and "M21-750-499" should return true).
- Fixed bug where users could not alternate between printing bitmaps and templates. It would print the same label that was set prior.
- TemplateDataNames now returns a Dictionary with the placeholder name mapped to the type of BWS object it is.
- Replaced API methods:
- CheckForPartMismatch with the SuppliesMatch API property.
- Feed() with FeedSupply()
- Cut() with CutSupply()
- GetPreviewBase64String() with GetPreview()
- Added API methods:
- YNumber (property)
- RibbonName (property)
- RibbonRemainingPercentage (property)
- SetAutomaticShutoffTime()
- SetTemplateWithFilePath()
- SetTemplateWithBase64()
- Removed API methods:
- PrinterDetailsString (property)
- SetTemplate()
1.7.0
- The first version of the MAUI wrapper that will be produced internally. This package includes everything supported in the BradyCorp.Xamarin.SDK NuGet package version 1.7.0