Guides / iOS and Apple Platform Engineering
How do I build a companion app for a Bluetooth speaker?
Build the app as a control layer, not an audio player. The phone pairs with the speaker in system Settings and plays audio on its own. Your app talks to the speaker over a second channel: Bluetooth Low Energy through Core Bluetooth, or the local network for Wi-Fi speakers. Add connection state, settings and firmware updates, then test on real hardware and submit to the App Store.
Start with what the app is for
A Bluetooth speaker already does its main job without an app. The phone pairs with it in system Settings, and the operating system routes audio to it. Your app should not try to replace that.
The companion app is the control layer. It shows the speaker's state and changes the things the system does not expose. Write that list down before you write any code, because it decides which connection channel you need.
- Status: connected or not, battery level, which speaker is which.
- Settings: the speaker's name, sound profile, lights and button behavior.
- Maintenance: firmware updates and support information.
- Setup: getting a Wi-Fi model onto the home network.
Choose how the app talks to the speaker
Audio and control are separate links. Audio travels over the system's Bluetooth audio connection. Control travels over whatever channel your hardware team exposes.
Bluetooth Low Energy with Core Bluetooth
This is the usual choice. The speaker advertises a GATT service, and the app scans, connects, then reads and writes characteristics. No Apple hardware program is needed. The message format is yours to design, so write it as a spec that firmware and app both follow.
Classic Bluetooth with External Accessory
If the control channel is classic Bluetooth rather than Low Energy, iOS only exposes it through the External Accessory framework, and the hardware must be part of Apple's MFi program. Settle this with the hardware team early. It affects chip choice and the schedule.
Wi-Fi and IoT speakers
Speakers that join the home network are usually found on the local network with Bonjour and controlled over a local or cloud API. The app needs a local network usage description, and iOS shows a permission prompt the first time. Setup is the hard part, because the app often has to hand Wi-Fi credentials to the speaker over Bluetooth first.
Build it in this order
- Permissions first. Add the Bluetooth usage description to Info.plist before the first scan. Without it, the app is terminated the moment it touches Core Bluetooth. Write the text for the user, not for the review team.
- A transport layer. One class owns scanning, connecting and reconnecting. The rest of the app never touches Core Bluetooth types.
- A protocol layer. Encode and decode messages with plain types so you can unit test them with no speaker attached.
- A connection state model. Make disconnected, connecting, connected, updating and error explicit states. Speakers get switched off, carried out of range, or grabbed by someone else's phone.
- UI driven by that state. Every screen needs a disconnected version.
- The firmware update flow, built last and with the most care. Check battery, keep the screen awake, resume after a drop, and agree with the firmware team on what happens if the transfer dies halfway.
- Background behavior only if you need it. Add the Bluetooth background mode for a real reason, because App Review will ask what it is for.
What shipping to the App Store involves
From July 2017 to September 2021, Nithin Gaddam built and maintained the Ultimate Ears Bluetooth and IoT speaker companion iOS apps at Logitech, shipped through the App Store. He also enabled continuous integration for QA and production builds and developed two private cocoapods. More background is on the home page.
A speaker app has a problem most apps do not: the app is only half the product. The speaker, its firmware and the app all have to agree. These are the parts of shipping that follow from that.
- Automate signing and builds. Certificates, profiles and bundle IDs should live in CI so any build can be reproduced.
- Produce QA and production builds from the same commit. Testers need builds before the store release, and the two should not drift apart.
- Give hardware testers real speakers. Distribute test builds to them early, and expect radio problems that a simulator will never show.
- Plan for review without your hardware. App Review may not own a speaker. Write review notes, and consider a demo mode that shows the main screens with nothing connected.
- Answer privacy questions honestly. Bluetooth and local network use must be declared, and the usage strings must explain why.
- Decide on firmware compatibility. New apps will meet old firmware and old apps will meet new firmware. Set minimum versions and show an update prompt instead of a broken screen.
- Share code between apps. If you ship more than one app or target, put transport and protocol code in a private pod or package so there is one copy to fix.
Maintenance is most of the work. The first release is a start, and every new speaker, firmware and iOS version comes back to the same app.
When a companion app is the wrong answer
iOS gives an app less control than people expect. An app cannot pair classic Bluetooth audio on its own, and reconnecting the audio link is mostly the operating system's job.
Mock transports let you test your protocol in CI, but they cannot test radio behavior. Budget time with real speakers either way.
If the speaker only needs power, volume and playback, the physical buttons and the system volume control may be enough. Skip the app until there is a setting, a firmware update or a setup step that really needs one.
Frequently asked questions
Can my iOS app pair with a Bluetooth speaker directly?
Not for classic Bluetooth audio. The user pairs it in system Settings. Your app can connect to a Low Energy control service through Core Bluetooth, but audio still plays through the system connection.
Do I need to join Apple's MFi program?
Only if the app talks to a classic Bluetooth accessory through the External Accessory framework. A Low Energy speaker controlled through Core Bluetooth does not need it.
How do I test the app in CI without a speaker?
Put a protocol and transport interface between the app and Core Bluetooth, and run unit tests against a mock. Let CI build the QA and production apps, and keep radio and firmware-update testing for real speakers.
Will App Review reject an app that needs hardware they do not have?
Not by default, but give them a way through. Add clear review notes and consider a demo mode that shows the main screens without a connected speaker.