Is there an alternative for flutter-bluetooth-serial package that can be used on both IOS and Android devices? - flutter

I have been working on a flutter app for few months now. The main feature that my app relying on is Bluetooth serial communication. Basically my app will connect and communicate (receive and send data) to HC-06 Bluetooth module that is connected with a microcontroller.
Everything was going great till the moment when I found out that flutter bluetooth serial package doesn’t actually work with Ios devices (have been doing all tests on android device).
So I’m wondering if there is a way to make it work on ios devices or if there is any alternative way that I can use to creat the serial communication between ios and Hc-06 device.

iOS does not support SPP (Serial Port Profile), which is the serial protocol you are almost certainly using with Android. You will need to redesign your system to use another protocol.
The HC-06 only supports Bluetooth 2.0+EDR, and I don't believe there is any protocol it can handle that is also supported by iOS (in a way accessible to developers). You would likely need to use a module that supports BLE GATT, which requires Bluetooth 4.
(iOS does support GATT over BR/EDR, but I don't believe that's available on the HC-06.)

taha! I recommend you to try this package flutter_blue.
I use it to connect my BLE device and communicate well.

Related

How to exchange data and files between two devices by NFC using Flutter?

I am a flutter developer, I want to make an application to exchange messages and files by using NFC technique
I used nfc_in_flutter plugin for reading and writing NFC tags but I don't know how to send and receive data and files between devices by using NFC in flutter.
Could any one help me, please?
Generally you don't try and send data between 2 devices using NFC, there is a standard for it, but most devices don't support it (it has never been supported on iOS and Android has dropped support for it as it was unreliable)
Use Bluetooth or Wifi Direct instead.
Update:
If you have to use NFC then the nfc_in_flutter plugin is no use, you are going to have to call native code for each platform yourself / write your own plugin.
And for 2 iOS devices, then forget it, just not possible because of what the OS supports.
When one device is an Android there is a complicated method that some people have had some success with but it still has it's issue.
The Android device does Host Card Emulation (HCE) and pretends to be a really Type 4 NFC tag, then other devices can read/write to it as if it were a real Tag which both iOS and Android Support. BUT on older Android devices then the deprecated Android Beam might get in the way and you would need to use enableReaderMode to do the read/write on Android.
You will need to put in a lot of error handle in the read/write App as NFC comms is very slow and very prone to loosing the connection, so it would have to handle loosing the connection and restarting where it last successful read from/written to.
All these problems make this extremely difficult to achieve a workable solution and was the main reason Google removed Android Beam for Android to Android sharing (which does use a NFC peer to peer protocol)

ModBus on Dart/Flutter through Bluetooth?

Our team develops custom device and an Android app which communicate through Bluetooth and ModBus, and we're going to recreate our app using Dart/Flutter so we will also have an iOS version. But is it possible to use ModBus with Bluetooth on this platform? I've found modbus package for Dart, but found nothing about using it with Bluetooth. Or, is there any analog to modbus which can be used on our device programmed in C, Java Android app, and Dart?

Flutter: Is it possible to make a P2P connection with nfc_in_flutter package?

I would like to send a message from an Android device to an IOS device using NFC.
I found multiple NFC packages and tried out example app from nfc_in_flutter but was not able to send a message between 2 phones.
Do they only support reading and writing to NFC-Tags or am I missing something?
iOS does not support Peer to Peer NFC even natively and Android has deprecated support for it in Android 10 (Android Beam).
So you are not missing something, iOS lags behind Android and only in iOS 13 supports reading/writing where as Android has supported reading/writing and Host Card Emulation for a long time.
Better to use Bluetooth or Wifi Direct

bluetooth GATT over BLE for iOS and Android?

I have a project that needs iOS/Android APP to communicate with embedded side via Bluetooth Low Energy(BLE) to transfer small amount of data. My embedded side is CSR chip which supports the dual mode.
Does anyone know is that possible for both Android and iOS to support this GATT over BLE? Any fee like joining developer program?
I think Android side should be OK, but I am very new to iOS and don't know it is easy to do so.
thanks
Yes Android supports GATT over BLE. Yes iOS supports GATT over BLE. Yes Apple requires you to be an Apple Developer in order to develop iOS apps and it costs $99/year. You will also need an Apple computer to do the development.

Does the iPhone sdk support l2cap bluetooth sockets?

Does the iPhone sdk support l2cap bluetooth sockets? Any additional information about SDK classes, etc would be greatly appreciated.
The latest CoreBluetooth does expose L2Cap through CBL2CAPChannel: https://developer.apple.com/documentation/corebluetooth/cbl2capchannel
It can be opened from a CBPeripheral: https://developer.apple.com/documentation/corebluetooth/cbperipheral/2880151-openl2capchannel
No.
There are no direct support for Bluetooth APIs in the SDk,
REfer the game kit programming APIs for application development with Bluetooth for peer-to-peer gaming
Other than than you will have to join the Made for iPod/iPhone/iPad program to get access and develop bluetooth connected accessories
Bad news from MFI FAQ (2014):
Q: I want to develop an accessory that communicates with an Apple device using only Bluetooth Low Energy. Do I need to join the MFi Program?
A: No. Accessories which connect to an Apple device using only Bluetooth Low Energy/BTLE/Bluetooth 4.0 or standard Bluetooth profiles supported by iOS are not part of the MFi Program.
I'm developing an app to connect with a L2CAP device on Android, now I'm studying porting on IOS but I found this issue.
For enabling a device to talk by Bluetooth, it must integrate the Apple authentication chip into device and must be able to connect with built-in Apple's Bonjour discovery service.
No L2CAP for any device... Sorry!
Website: https://mfi.apple.com
Source: https://mfi.apple.com/MFiWeb/getFAQ.action#4-2