Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_ble_peripheral] didStartAdvertising: Error "Advertising has already started" on iOS #205

Open
Kat-Whitehouse opened this issue Oct 2, 2024 · 2 comments

Comments

@Kat-Whitehouse
Copy link

I have picked up the development on an app which uses a phone to send BLE data to an IOT device. The app works as it should on Android, but as we all know, it works completely differently on iOS.

I can only seem to send one advertiseData packet and then the iPhone just continues to send it. I have a sniffer (using Tera Term) and so I can see what is being sent. If I then send another advertiseData packet, it is just ignored by the IOT device. I cannot find a way of stopping the iPhone from advertising so that I can send the new packet to the device. The .stop() doesn't seem to do anything and the iPhone just continuously advertises the original advertiseData packet.

Does anyone have any ideas? How do I use .stop() please? Incidentally, the Android code does not need to use .stop(). When I send new advertiseData, it just does it and the device responds as it should.

@Kat-Whitehouse
Copy link
Author

Figured this out eventually.

You have to call the .stop before the .start().

@huzaifa846
Copy link

facing same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants