0 Replies Latest reply on Mar 21, 2017 3:39 AM by Robert Steenkamp

    Xamarin IOS BluetoothDiscoverer error

    Robert Steenkamp

      We are currently developing a Xamarin Cross platform app in Android and iOS. The Android side of things has been implemented and I've begun implementing the iOS specific side of things and I'm running into a problem when trying to discover printers. I've used the recommended code from the SDK:

       

      BluetoothDiscoverer.Current.FindPrinters(null, handler);

       

      but it finishes immediately and a message in the debug window appears with: Couldn't find the "com.apple.private.externalaccessory.showallaccessories" entitlement

      I have googled this extensively and this is an issue with iOS 10 that should be solved by adding the following to the info.plist:

       

      <key>NSBluetoothPeripheralUsageDescription</key>

        <string>Access Bluetooth</string>

        <key>UIBackgroundModes</key>

        <array>

        <string>external-accessory</string>

        </array>

        <key>UISupportedExternalAccessoryProtocols</key>

        <array>

        <string>com.zebra.rawport</string>

        <string>com.zebra.protocols</string>

        </array>

       

      Which is also what the Zebra guide recommends I add, and I have.

      I've also run the following code:

       

      EAAccessoryManager mgr = EAAccessoryManager.SharedAccessoryManager;

      var accessories = mgr.ConnectedAccessories;

       

      which is the usual place where this error appears for others, the error does appear here too but it's still able to find the printer (iMZ320)

       

      Does anyone have any advice on what I could be doing wrong?