BradyCorp.Maui.SDK 2.0.0

There is a newer version of this package available.
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
                    
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="BradyCorp.Maui.SDK" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BradyCorp.Maui.SDK" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BradyCorp.Maui.SDK" />
                    
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 BradyCorp.Maui.SDK --version 2.0.0
                    
#r "nuget: BradyCorp.Maui.SDK, 2.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.
#addin nuget:?package=BradyCorp.Maui.SDK&version=2.0.0
                    
Install BradyCorp.Maui.SDK as a Cake Addin
#tool nuget:?package=BradyCorp.Maui.SDK&version=2.0.0
                    
Install BradyCorp.Maui.SDK as a Cake Tool

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 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. 
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
3.0.0 169 9/11/2024
2.0.0 93 8/6/2024
1.7.0 153 4/25/2024

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