Prerequisites and Project Configuration Settings

To run this application, ensure that you have the following prerequisites:

Development Environment

  1. Microsoft Visual Studio 2022 version 17.8 or newer.

  2. .NET SDK 8.

  3. For iOS execution, Xcode 15 or a later version is necessary.

Configuring Printer Discovery on Android

  1. Open the AndroidManifest.xml file in your Android project.

  2. Add the following permissions if your app requires Bluetooth Discovery and requires runtime permission management based on the Android version. For devices with Android versions below 12, acquiring the ACCESS_COARSE_LOCATION permission is necessary. Conversely, for devices running Android 12 and above, both the BLUETOOTH_SCAN and BLUETOOTH_CONNECT permissions are required.:

    AndroidManifest.xml
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
  3. Add the following permissions if your app requires Network Discovery:

    AndroidManifest.xml
    <uses-permission android:name="android.permission.INTERNET" />

Configuring Printer Discovery on iOS

  1. Open the Info.plist file in your iOS project. Add the following permissions for Bluetooth Discovery:

    Info.plist
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>please-always-allow-bluetooth-usage !</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>please-always-allow-bluetooth-usage !</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>external-accessory</string>
    </array>
    <key>UISupportedExternalAccessoryProtocols</key>
    <array>
        <string>com.zebra.rawport</string>
    </array>
  2. Add the following to Entitlement.plist for Network Multicast:

    Entitlement.plist
    <key>com.apple.developer.networking.multicast</key>
    <true/>