Skip to content

fix: skip Bluetooth address and UUID validation on iOS - #4

Merged
almasumdev merged 1 commit into
almasumdev:mainfrom
abbiyuarsyah:fix/ios-address-issue
Jul 17, 2026
Merged

fix: skip Bluetooth address and UUID validation on iOS#4
almasumdev merged 1 commit into
almasumdev:mainfrom
abbiyuarsyah:fix/ios-address-issue

Conversation

@abbiyuarsyah

@abbiyuarsyah abbiyuarsyah commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

On iOS, Bluetooth devices are not identified by MAC addresses like on Android. Instead, iOS assigns its own UUIDs (e.g., A1B2C3D4-E5F6-7890-...) to discovered peripherals.

The original library validates device addresses against a MAC address regex (XX:XX:XX:XX:XX:XX). Since iOS identifiers never match that format, every call to connectToDevice, bondDevice, or writeToDevice throws a BtcAddressException on iOS making the library unusable on that platform.

The same issue applies to _validateUuid, the UUID format iOS provides may not match the regex the library expects.
Adding if (Platform.isIOS) return; skips these Android-specific format checks on iOS and lets the platform channel handle the identifiers natively.

This has been tested using two Bluetooth printers connected to multiple iPhones.

@almasumdev
almasumdev merged commit 4cc661e into almasumdev:main Jul 17, 2026
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants