Bug: Unable to use ionic 5 + Bluetooth Serial + Capacitor to print on bluetooth printer

Hi there,

I’m currently working on an app that requires some printing with bluetooth printers.
I setup everything as in the docs but when I try to test it on an ios device it logs the following message on Xcode console.

To Native Cordova -> BluetoothSerial discoverUnpaired BluetoothSerial1510874868 [“options”: []]
Error: Plugin MEGBluetoothSerial does not respond to method call discoverUnpaired:.
Ensure plugin method exists and uses @objc in its declaration
To Native Cordova -> BluetoothSerial list BluetoothSerial1510874869 [“options”: []]

I’m currently working with the following Hardware:

  • iphone x (version 13.3.1)
  • google one plus 3.

Versions:

  • ionic 5
    @ionic/angular”: “^5.0.0”,
    @ionic-native/bluetooth-serial”: “^5.22.0”,
    “cordova-plugin-bluetooth-serial”: “^0.4.7”,

Note: Someone suggested that I should add the following code to capacitor.config.json:
“ios”: {
“cordovaSwiftVersion”: “3.0”,
“cordovaLinkerFlags”: [
“-ObjC”
]
}
Any thoughts?

Thanks for the quick support,
Hope to hear from you soon,
Tiago

Hello,
Which bluetooth printer are you trying to use? I’ve worked with a couple printers and I ended up creating my custom plugins since printing on iOS is more strict.